Created
July 15, 2019 08:16
-
-
Save ducmeit1/c6c05c6e820cc3fc4367230c1c621d59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Customer.Domain.Commands; | |
using Customer.Domain.Dtos; | |
using Customer.Domain.Queries; | |
using MediatR; | |
using Microsoft.AspNetCore.Mvc; | |
namespace Customer.API.Controllers | |
{ | |
public class CustomerController : ApiControllerBase | |
{ | |
public CustomerController(IMediator mediator) : base(mediator) | |
{ | |
} | |
/// <summary> | |
/// Create new customer | |
/// </summary> | |
/// <param name="command">Info of customer</param> | |
/// <returns></returns> | |
[HttpPost] | |
[ProducesResponseType(200)] | |
[ProducesResponseType(400)] | |
public async Task<ActionResult> CreateCustomerAsync([FromBody] CreateCustomerCommand command) | |
{ | |
return Ok(await CommandAsync(command)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment