public static internalDTO.UserFavouriteProvider MapFromExternal(externalDTO.UserFavouriteProvider userFavouriteProvider)
        {
            var res = userFavouriteProvider == null ? null : new internalDTO.UserFavouriteProvider
            {
                Id         = userFavouriteProvider.Id,
                ProviderId = userFavouriteProvider.ProviderId,
                Provider   = ProviderMapper.MapFromExternal(userFavouriteProvider.Provider),
                AppUserId  = userFavouriteProvider.AppUserId
            };


            return(res);
        }
        public static internalDTO.FoodItem MapFromExternal(externalDTO.FoodItem foodItem)
        {
            var res = foodItem == null ? null : new internalDTO.FoodItem
            {
                Id             = foodItem.Id,
                ProviderId     = foodItem.ProviderId,
                Provider       = ProviderMapper.MapFromExternal(foodItem.Provider),
                DateStart      = foodItem.DateStart,
                DateEnd        = foodItem.DateEnd,
                FoodCategoryId = foodItem.FoodCategoryId,
                FoodCategory   = FoodCategoryMapper.MapFromExternal(foodItem.FoodCategory),
                NameEng        = foodItem.NameEng,
                NameEst        = foodItem.NameEst
            };


            return(res);
        }
        public static externalDTO.FoodItem MapFromBLL(internalDTO.FoodItem foodItem)
        {
            var res = foodItem == null ? null : new externalDTO.FoodItem
            {
                Id             = foodItem.Id,
                ProviderId     = foodItem.ProviderId,
                Provider       = ProviderMapper.MapFromBLL(foodItem.Provider),
                DateStart      = foodItem.DateStart,
                DateEnd        = foodItem.DateEnd,
                FoodCategoryId = foodItem.FoodCategoryId,
                FoodCategory   = FoodCategoryMapper.MapFromBLL(foodItem.FoodCategory),
                NameEng        = foodItem.NameEng,
                NameEst        = foodItem.NameEst,
                Prices         = foodItem.Prices?.Select(PriceMapper.MapFromBLL).ToList()
            };


            return(res);
        }
Exemple #4
0
        public static PublicApi.v1.DTO.FoodItemWithCounts MapFromBLL(BLL.App.DTO.FoodItemWithCounts foodItem)
        {
            var res = foodItem == null ? null : new PublicApi.v1.DTO.FoodItemWithCounts()
            {
                Id                  = foodItem.Id,
                ProviderId          = foodItem.ProviderId,
                Provider            = ProviderMapper.MapFromBLL(foodItem.Provider),
                DateStart           = foodItem.DateStart,
                DateEnd             = foodItem.DateEnd,
                FoodCategoryId      = foodItem.FoodCategoryId,
                FoodCategory        = FoodCategoryMapper.MapFromBLL(foodItem.FoodCategory),
                NameEng             = foodItem.NameEng,
                NameEst             = foodItem.NameEst,
                CommentCount        = foodItem.CommentCount,
                RatingCount         = foodItem.RatingCount,
                DepletedReportCount = foodItem.DepletedReportCount,
                Prices              = foodItem.Prices.Select(PriceMapper.MapFromBLL).ToList(),
                FoodItemTags        = foodItem.FoodItemTags.Select(FoodItemTagMapper.MapFromBLL).ToList()
            };

            return(res);
        }