Ejemplo n.º 1
0
        public static RecipeTags From(params RecipeTag[] tags)
        {
            var ret = new RecipeTags();

            ret.tags.AddRange(tags);

            return(ret);
        }
Ejemplo n.º 2
0
        public static RecipeTags Parse(string list)
        {
            var tagsAsString = list.Split(',').Select(t => t.Replace(" ", string.Empty));
            var tags         = tagsAsString.Select(t => (RecipeTag)Enum.Parse(typeof(RecipeTag), t)).Distinct().ToArray();
            var recipeTags   = new RecipeTags(tags);

            return(recipeTags);
        }
Ejemplo n.º 3
0
        public Recipe(Guid id, RecipeTags tags, IngredientUsage[] ingredients)
        {
            this.ingredients = new IngredientUsageCollection();

            this.Id          = id;
            this.Tags        = tags;
            this.Ingredients = ingredients;
        }
Ejemplo n.º 4
0
        public static RecipeTags Parse(string list)
        {
            var tags = from t in list.Split(',') select t.Trim();

            var ret = new RecipeTags();

            ret = tags.Aggregate(ret, (current, tag) => current | (RecipeTag)tag);

            return(ret);
        }