public async Task <IReadOnlyList <Order> > GetOrdersByUserNameAsync(string userName) { OrderWithItemsAndOrederingSpecification spec = new OrderWithItemsAndOrederingSpecification(userName); return(await _unitOfWork.Repository <Order>().ListAsync(spec)); }
public async Task <Order> GetOrderByIdAsync(int id, string userName) { OrderWithItemsAndOrederingSpecification spec = new OrderWithItemsAndOrederingSpecification(id, userName); return(await _unitOfWork.Repository <Order>().GetEntityWithSpecAsync(spec)); }