//partial void RunCustomLogicAfterInsert(ref entCM.Log newDBItem, ref IRepositoryActionResult<entCM.Log> result) {}

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

        partial void RunCustomLogicAfterUpdatePut(ref entCM.Log updatedDBItem, ref IRepositoryActionResult <entCM.Log> 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.Log> >(() => Repo.InsertAsync(localDBItem));
                if (insertResult.Status == Enums.RepositoryActionStatus.Created)
                {                   // Insert worked
                    result = new RepositoryActionResult <entCM.Log>(insertResult.Entity, Enums.RepositoryActionStatus.Updated);
                }
            }
        }
Example #2
0
 partial void RunCustomLogicOnGetEntityByPK(ref entCM.Log dbItem, int id, int numChildLevels);
Example #3
0
 partial void RunCustomLogicAfterUpdatePut(ref entCM.Log updatedDBItem, ref IRepositoryActionResult <entCM.Log> result);
Example #4
0
 partial void RunCustomLogicBeforeUpdatePut(ref entCM.Log updatedDBItem, int id);
Example #5
0
 partial void RunCustomLogicAfterInsert(ref entCM.Log newDBItem, ref IRepositoryActionResult <entCM.Log> result);