Esempio n. 1
0
 public virtual async Task <List <Shop> > GetShopByUserShopIdForDropDown(int?shopId)
 {
     return(await RepositoryDbSet
            .Include(a => a.ShopName).ThenInclude(t => t.Translations)
            .Include(a => a.ShopAddress).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact2).ThenInclude(t => t.Translations)
            .Where(s => s.Id == shopId).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync());
 }
Esempio n. 2
0
        public override async Task <Shop> FindAsync(params object[] id)
        {
            var shop = await RepositoryDbSet.FindAsync(id);

            return(ShopMapper.MapFromDomain(await RepositoryDbSet
                                            .Include(a => a.ShopName).ThenInclude(t => t.Translations)
                                            .Include(a => a.ShopAddress).ThenInclude(t => t.Translations)
                                            .Include(a => a.ShopContact).ThenInclude(t => t.Translations)
                                            .Include(a => a.ShopContact2).ThenInclude(t => t.Translations)
                                            .Where(a => a.Id == shop.Id)
                                            .FirstOrDefaultAsync()));
        }
Esempio n. 3
0
        public async Task <List <Shop> > AllAsync(string order, string searchFor, int?pageIndex, int?pageSize)
        {
            var query = RepositoryDbSet.Include(a => a.ShopName).ThenInclude(t => t.Translations)
                        .Include(a => a.ShopAddress).ThenInclude(t => t.Translations)
                        .Include(a => a.ShopContact).ThenInclude(t => t.Translations)
                        .Include(a => a.ShopContact2).ThenInclude(t => t.Translations).AsQueryable();

            query = Search(query, searchFor);
            query = Order(query, order);
            if (pageIndex != null && pageSize != null)
            {
                query = query.Skip((pageIndex.Value - 1) * pageSize.Value).Take(pageSize.Value);
            }
            var temp = await query.ToListAsync();

            var res = temp.Select(e => ShopMapper.MapFromDomain(e)).ToList();

            return(res);
        }
Esempio n. 4
0
 public virtual async Task <List <Shop> > GetShopByUserShopId(int?shopId)
 {
     return(await RepositoryDbSet
            .Include(a => a.ShopName).ThenInclude(t => t.Translations)
            .Include(a => a.ShopAddress).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact2).ThenInclude(t => t.Translations)
            .Include(s => s.Inventories).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations)
            .Include(s => s.Orders).ThenInclude(m => m.Description).ThenInclude(t => t.Translations)
            .Include(a => a.Products).ThenInclude(aa => aa.ProductName).ThenInclude(t => t.Translations)
            .Include(a => a.Products).ThenInclude(aa => aa.Length).ThenInclude(t => t.Translations)
            .Include(a => a.Products).ThenInclude(aa => aa.Weight).ThenInclude(t => t.Translations)
            .Include(a => a.Products).ThenInclude(aa => aa.ManuFacturerItemCode).ThenInclude(t => t.Translations)
            .Include(a => a.Products).ThenInclude(aa => aa.ShopCode).ThenInclude(t => t.Translations)
            .Include(s => s.Returns).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations)
            .Include(d => d.Defects).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations)
            .Include(s => s.AppUsers)
            .Where(s => s.Id == shopId).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync());
 }
Esempio n. 5
0
 public override async Task <List <Shop> > AllAsync()
 {
     return(await RepositoryDbSet.Include(a => a.ShopName).ThenInclude(t => t.Translations)
            .Include(a => a.ShopAddress).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact).ThenInclude(t => t.Translations)
            .Include(a => a.ShopContact2).ThenInclude(t => t.Translations).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync());
 }