public async Task Create(PriceList priceList) { if (!Validate(new PriceListValidation(), priceList)) { return; } _priceListRepository.Create(priceList); await UnitOfWork.Save(); }
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()); } }