public async Task <IActionResult> Put(Guid id, [FromBody] UpdateCampaignCommand command) { if (!this.ModelState.IsValid) { return(this.BadRequest(this.ModelState)); } var response = await this._mediator.Send(command); return(this.Ok()); }
public async Task <IActionResult> PutAsync(int id, [FromBody] UpdateCampaignCommand command, CancellationToken cancellationToken = default) { command.Id = id; var campaign = await this.mediator.Send(command, cancellationToken); if (campaign == null) { return(NotFound()); } return(Ok(campaign)); }
public Task <Response <Campaign> > UpdateCampaign(UpdateCampaignCommand command) { return(_context.UpdateCampaign(command.IdOfCampaign, command)); }
public async Task <Guid> UpdateCampaignAsync([FromBody] UpdateCampaignCommand command) => await _mediator.Send(command);
public async Task <IActionResult> PostCampaignAsync(UpdateCampaignCommand command) { var response = await Mediator.Send(command); return(Accepted(response)); }