public async Task <IActionResult> Put(int id, UpdatePlaceCommand command) { if (id != command.Id) { return(BadRequest()); } return(Ok(await _mediator.Send(command))); }
public PlaceInputViewModel(Place newPlace, IPlaceService placeService, ICountryService countryService, ILogging logger, Window window) { PlaceService = placeService; CountryService = countryService; Logger = logger; Window = window; NewPlace = newPlace; if (NewPlace.IsValid()) { SavePlaceCommand = new UpdatePlaceCommand(this); } else { SavePlaceCommand = new AddPlaceCommand(this); } InitCountries(); }
public async Task <IActionResult> UpdatePlace([FromBody] UpdatePlaceCommand command) => Ok(await _mediator.Send(command));