예제 #1
0
        public async Task AddAsync(Guid id, Guid userId)
        {
            var @orderList = await _orderListRepository.GetAsync(id);

            @orderList = new OrderList(id, userId);
            await _orderListRepository.AddAsync(@orderList);
        }
예제 #2
0
        public static async Task <OrderList> GetOrFailAsync(this IOrderListRepository repository, Guid id)
        {
            var orderList = await repository.GetAsync(id);

            if (orderList == null)
            {
                throw new Exception($"OrderList with id: '{id}' does not exist.");
            }

            return(orderList);
        }