Example #1
0
        public static Domain.Category MapFromDAL(DAL.App.DTO.DomainLikeDTO.Category category)
        {
            var res = category == null ? null : new Domain.Category
            {
                Id           = category.Id,
                CategoryName = new MultiLangString(category.CategoryName),
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromDAL(category.Shop)
            };

            return(res);
        }
Example #2
0
        public static BLL.App.DTO.DomainLikeDTO.Category MapFromDAL(DAL.App.DTO.DomainLikeDTO.Category category)
        {
            var res = category == null ? null : new BLL.App.DTO.DomainLikeDTO.Category
            {
                Id           = category.Id,
                CategoryName = category.CategoryName,
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromDAL(category.Shop)
            };

            if (category?.ProductsInCategory != null)
            {
                res.ProductsInCategory = category.ProductsInCategory.Select(e => ProductInCategoryMapper.MapFromDAL(e)).ToList();
            }
            return(res);
        }