Exemplo n.º 1
0
 public async Task Create(PriceList priceList)
 {
     if (!Validate(new PriceListValidation(), priceList))
     {
         return;
     }
     _priceListRepository.Create(priceList);
     await UnitOfWork.Save();
 }
Exemplo n.º 2
0
        public async Task <ActionResult <PriceList> > CreatePrice([FromBody] PriceList price)
        {
            try
            {
                await _repository.Create(price);

                return(CreatedAtRoute("GetPrice", new { id = price.PriceListId }, price));
            }
            catch (Exception exc)
            {
                _logger.LogError($"Error: {exc}");
                // transaction.Rollback();
                return(NotFound());
            }
        }