예제 #1
0
 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();
 }
예제 #3
0
 public async Task <IActionResult> UpdatePlace([FromBody] UpdatePlaceCommand command)
 => Ok(await _mediator.Send(command));