public Task <PurchaseOrderDto> CreatePurchaseOrderAsync(PurchaseOrderDto dto) { if (dto == null) { return(Task.FromResult <PurchaseOrderDto>(null)); } dto.Id = Guid.NewGuid(); list.Add(dto); return(dto.AsTask()); }
public Task <PurchaseOrderDto> UpdatePurchaseOrderAsync(Guid id, PurchaseOrderDto dto) { if (dto == null) { return(Task.FromResult <PurchaseOrderDto>(null)); } list.RemoveAll(c => c.Id == id); dto.Id = id; list.Add(dto); return(dto.AsTask()); }