public async Task <IActionResult> CreatePhoto([FromBody] CreatePhotoCommand command) { var result = await _mediator.Send(command); if (result == null) { return(BadRequest(ModelState)); } return(CreatedAtRoute("GetPhoto", new { photoId = result.Id }, result)); }
public PhotoController(IOptions <CloudinarySettings> cloudinaryOptions, CreatePhotoCommand createPhotoCommand) { _cloudinaryOptions = cloudinaryOptions; _createPhotoCommand = createPhotoCommand; }