コード例 #1
0
        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());
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public Task <Response <Campaign> > UpdateCampaign(UpdateCampaignCommand command)
 {
     return(_context.UpdateCampaign(command.IdOfCampaign, command));
 }
コード例 #4
0
 public async Task <Guid> UpdateCampaignAsync([FromBody] UpdateCampaignCommand command)
 => await _mediator.Send(command);
コード例 #5
0
        public async Task <IActionResult> PostCampaignAsync(UpdateCampaignCommand command)
        {
            var response = await Mediator.Send(command);

            return(Accepted(response));
        }