public override async Task <IActionResult> Patch(int Id, [FromBody] JsonPatchDocument <UserViewModel> pathDocument) { Func <Task <UserViewModel> > predicate = async() => { return(await PathDataAsync(Id, pathDocument)); }; var result = await SafeExecutor <UserViewModel> .ExecAsync(predicate); return(ProcessResponse(result)); }
public async Task <IActionResult> Login( [FromBody] UserViewModel viewModel, string origin) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Func <Task <UserViewModel> > predicate = async() => { if (origin is null) { return(await ProcessLocalUser(viewModel)); } else { return(await ProcessSocialNetworkUser(viewModel)); } }; var result = await SafeExecutor <UserViewModel> .ExecAsync(predicate); return(ProcessResponse(result)); }