public async Task <ActionResult> Update(AbookUpdateModel abook) { return(await PatchResult( async() => await abookService.Update(abook), nameof(abook) )); }
public virtual async Task <(AbookViewModel, ServiceModelState)> Update( AbookUpdateModel model) { var user = context.GetCurrentUser(); var edit = await context.Abooks .WhereById(user.CurrentAbookId) .SingleOrDefaultAsync(); if (edit != null) { model.Attach(edit); await context.SaveChangesAsync(); } return(AbookViewModel.Of(edit), null); }