Esempio n. 1
0
        public static BLL.App.DTO.FoodItem MapFromDAL(DAL.App.DTO.FoodItem foodItem)
        {
            var res = foodItem == null ? null : new BLL.App.DTO.FoodItem
            {
                Id             = foodItem.Id,
                ProviderId     = foodItem.ProviderId,
                Provider       = ProviderMapper.MapFromDAL(foodItem.Provider),
                DateStart      = foodItem.DateStart,
                DateEnd        = foodItem.DateEnd,
                FoodCategoryId = foodItem.FoodCategoryId,
                FoodCategory   = FoodCategoryMapper.MapFromDAL(foodItem.FoodCategory),
                NameEng        = foodItem.NameEng,
                NameEst        = foodItem.NameEst,
                Prices         = foodItem.Prices?.Select(PriceMapper.MapFromDAL).ToList()
            };


            return(res);
        }
Esempio n. 2
0
        public static BLL.App.DTO.FoodItemWithCounts MapFromDAL(DAL.App.DTO.FoodItemWithCounts foodItem)
        {
            var res = foodItem == null ? null : new BLL.App.DTO.FoodItemWithCounts()
            {
                Id                  = foodItem.Id,
                ProviderId          = foodItem.ProviderId,
                Provider            = ProviderMapper.MapFromDAL(foodItem.Provider),
                DateStart           = foodItem.DateStart,
                DateEnd             = foodItem.DateEnd,
                FoodCategoryId      = foodItem.FoodCategoryId,
                FoodCategory        = FoodCategoryMapper.MapFromDAL(foodItem.FoodCategory),
                NameEng             = foodItem.NameEng,
                NameEst             = foodItem.NameEst,
                CommentCount        = foodItem.CommentCount,
                RatingCount         = foodItem.RatingCount,
                DepletedReportCount = foodItem.DepletedReportCount,
                Prices              = foodItem.Prices.Select(PriceMapper.MapFromDAL).ToList(),
                FoodItemTags        = foodItem.FoodItemTags.Select(FoodItemTagMapper.MapFromDAL).ToList()
            };

            return(res);
        }