private Buyer Convert(BuyerDto buyerDto, bool isUpdate) { Buyer buyer = new Buyer() { FIO = buyerDto.FIO, IsLegalEntity = buyerDto.IsLegalEntity, Phone = buyerDto.Phone }; if (isUpdate) { buyer.Id = buyerDto.Id; } return(buyer); }
public void EditBuyer(BuyerDto buyerDto) { repositories.buyerRepository.Update(Convert(buyerDto, true)); }
public void AddBuyer(BuyerDto buyerDto) { repositories.buyerRepository.Create(Convert(buyerDto, false)); }