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

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

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