Ejemplo n.º 1
0
        public async Task <List <SidebarCategoriesModel> > BindSideBarCategories(int id)
        {
            SidebarCategoriesMapper mapper = new SidebarCategoriesMapper();
            var order = await scope.CategoryRepository.FetchByAsync(p => p.Id == id);

            return(mapper.EntityToModel(order.FirstOrDefault()));
        }
Ejemplo n.º 2
0
        public ProductCategoryModel EntityToModel(Category entity, List <Product> entity2)
        {
            ProductCategoryModel    res     = new ProductCategoryModel();
            SidebarCategoriesMapper mapper2 = new SidebarCategoriesMapper();
            ProductsMapper          mapper  = new ProductsMapper();

            res.Category = mapper2.EntityToModel(entity);
            res.Items    = mapper.EntityToModel(entity2);
            return(res);
        }