Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
 public IGenericRepository <TEntity> Repository <TEntity>() where TEntity : BaseEntity
 {
     return(_genericRepoResolver.Repository <TEntity>());
 }