Exemplo n.º 1
0
        //partial void RunCustomLogicAfterInsert(ref entCM.LanguageType newDBItem, ref IRepositoryActionResult<entCM.LanguageType> result) {}

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

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