示例#1
0
        //partial void RunCustomLogicAfterInsert(ref entCM.BlobFileType newDBItem, ref IRepositoryActionResult<entCM.BlobFileType> result) {}

        //partial void RunCustomLogicAfterUpdatePatch(ref entCM.BlobFileType updatedDBItem, ref IRepositoryActionResult<entCM.BlobFileType> result) {}

        partial void RunCustomLogicAfterUpdatePut(ref entCM.BlobFileType updatedDBItem, ref IRepositoryActionResult <entCM.BlobFileType> result)
        {
            if (result.Status == Enums.RepositoryActionStatus.NotFound)
            {                   // An update/PUT was attempted when it should have been a create/POST.
                var localDBItem  = updatedDBItem;
                var insertResult = Utils.AsyncHelper.RunSync <IRepositoryActionResult <entCM.BlobFileType> >(() => Repo.InsertAsync(localDBItem));
                if (insertResult.Status == Enums.RepositoryActionStatus.Created)
                {                   // Insert worked
                    result = new RepositoryActionResult <entCM.BlobFileType>(insertResult.Entity, Enums.RepositoryActionStatus.Updated);
                }
            }
        }
 partial void RunCustomLogicOnGetEntityByPK(ref entCM.BlobFileType dbItem, int blobFileTypeId, int numChildLevels);
 partial void RunCustomLogicBeforeUpdatePut(ref entCM.BlobFileType updatedDBItem, int blobFileTypeId);
 partial void RunCustomLogicAfterUpdatePut(ref entCM.BlobFileType updatedDBItem, ref IRepositoryActionResult <entCM.BlobFileType> result);
 partial void RunCustomLogicAfterInsert(ref entCM.BlobFileType newDBItem, ref IRepositoryActionResult <entCM.BlobFileType> result);