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

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

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