public async Task <ActionResult <IReadOnlyList <OrderDto> > > GetOrdersForUser() { var email = HttpContext.User.RetrieveEmailFromPrincipal(); var spec = new OrdersWithItemsAndOrderingSpecification(email); var orders = await _repoResolver.Repository <Order>().ListAsync(spec); return(Ok(_mapper.Map <IReadOnlyList <Order>, IReadOnlyList <OrderToReturnDto> >(orders))); }
public IGenericRepository <TEntity> Repository <TEntity>() where TEntity : BaseEntity { return(_genericRepoResolver.Repository <TEntity>()); }