Exemplo n.º 1
0
        /// <inheritdoc cref="IFactory.CreateNewRating"/>>
        public RatingDto CreateNewRating(int id, int totalVotes, double totalValue, int recipeId, string originIp)
        {
            var dto = new RatingDto
            {
                Id         = id,
                TotalValue = totalValue,
                TotalVotes = totalVotes,
                RecipeId   = recipeId,
                OriginIp   = originIp
            };

            return(dto);
        }
Exemplo n.º 2
0
        /// <inheritdoc cref="IFactory.CreateNewRecipe"/>>
        public RecipeDto CreateNewRecipe(int id, string submittedBy, string title, ICode variety, string description,
                                         string ingredients, string instructions, RatingDto rating, bool enabled, bool needsApproved, int hits, List <ImageFileDto> imageFiles)
        {
            var dto = new RecipeDto
            {
                Id            = 0,
                SubmittedBy   = submittedBy,
                Title         = title,
                Variety       = variety,
                Description   = description,
                Ingredients   = ingredients,
                Instructions  = instructions,
                Rating        = rating,
                Enabled       = enabled,
                NeedsApproved = needsApproved,
                Hits          = hits
            };

            dto.ImageFiles.AddRange(imageFiles);

            return(dto);
        }