public async Task <IActionResult> UpdatePhoto(string photoId, [FromBody] UpdatePhotoCommand command) { var result = await _mediator.Send(command); if (result == null || photoId != result.Id) { return(BadRequest(ModelState)); } return(NoContent()); }
public UpdateContactPageViewModel(MyContact contactToUpdate, INavigation navigator) { this.contactToUpdate = contactToUpdate; this.navigator = navigator; dataService = DependencyService.Get <IDataService>(); UpdateCommand = Name.Select(a => !string.IsNullOrEmpty(a)). CombineLatest(Mobile.Select(b => !string.IsNullOrEmpty(b)), (a, b) => a && b).ToReactiveCommand(); UpdateCommand.Subscribe(async() => await ExecuteUpdateCommand()); DeleteCommand.Subscribe(async() => await ExecuteDeleteCommand()); MarkFavoriteCommand.Subscribe(async() => ExecuteMarkFavoriteCommand()); UpdatePhotoCommand.Subscribe(async() => await ExecuteUpdatePhotoCommand()); }
public async Task <ActionResult <ResponseWrapper> > UpdatePhotoAsync([FromBody] UpdatePhotoCommand command) { var result = await _mediator.Send(command); return(Ok(ResponseWrapper.CreateOkResponseWrapper(result))); }