コード例 #1
0
        public static SimpleDishDTO CreateFromDomainWithAssociatedTables(Dish d)
        {
            var dish = CreateFromDomain(d);

            if (dish == null)
            {
                return(null);
            }

            dish.Promotion = SimplePromotionDTO.CreateFromDomain(d.Promotion);
            return(dish);
        }
コード例 #2
0
        public static DishDTO CreateFromDomainWithAssociatedTables(Dish d)
        {
            var dish = CreateFromDomain(d);

            if (dish == null)
            {
                return(null);
            }

            dish.Promotion   = SimplePromotionDTO.CreateFromDomain(d.Promotion);
            dish.Ingredients = d.DishIngredients.Select(IngredientDTO.CreateFromDishIngredientDomain).ToList();
            dish.Rating      = d.RatingLogs.Any() ? Rating.CreateWithComments(d.RatingLogs) : null;
            return(dish);
        }