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

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

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