Exemple #1
0
        public async Task <ActionResult <Customer> > CreateAsync([FromBody] CreateCustomerCommand customer)
        {
            var entity = customer.Build();

            await _defaultDbContext.AddAsync(entity);

            await _defaultDbContext.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetById), new { id = entity.Id }, entity));
        }