public EntityReceiverDto Delete(IObjectIdentifier <ulong> id) { var receiver = _repository.FindById(id); _repository.Delete(receiver.Id); return(EntityReceiverDto.FromDomain(receiver)); }
public static InvoiceDto FromDomain(Invoice invoice) { return(new InvoiceDto( invoice.Id, invoice.IssueDate, invoice.DueDate, invoice.RedemptionDate, invoice.Items.Select(InvoiceItemDto.FromDomain).ToList(), invoice.Payments.Select(InvoicePaymentDto.FromDomain).ToList(), EntitySupplierDto.FromDomain(invoice.Supplier), EntityReceiverDto.FromDomain(invoice.Receiver) )); }
private InvoiceDto( IObjectIdentifier <ulong> id, DateTime issueDate, DateTime dueDate, DateTime?redemptionDate, List <InvoiceItemDto> items, List <InvoicePaymentDto> payments, EntitySupplierDto supplier, EntityReceiverDto receiver ) { _id = id; _issueDate = issueDate; _dueDate = dueDate; _redemptionDate = redemptionDate; _items = items; _payments = payments; _supplier = supplier; _receiver = receiver; }
public EntityReceiverDto Delete(EntityReceiverDto receiver) { _repository.Delete(receiver.Id); return(receiver); }
public EntityReceiverDto Create(EntityReceiverDto entity) { throw new System.NotImplementedException(); }
public EntityReceiverDto GetById(IObjectIdentifier <ulong> id) => EntityReceiverDto.FromDomain(_repository.FindById(id));