Exemple #1
0
        public Task <PurchaseOrderDto> CreatePurchaseOrderAsync(PurchaseOrderDto dto)
        {
            if (dto == null)
            {
                return(Task.FromResult <PurchaseOrderDto>(null));
            }

            dto.Id = Guid.NewGuid();
            list.Add(dto);

            return(dto.AsTask());
        }
Exemple #2
0
        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());
        }