-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecipe.cs
More file actions
35 lines (27 loc) · 737 Bytes
/
Copy pathRecipe.cs
File metadata and controls
35 lines (27 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class Recipe
{
public uint UID { get; set; } = 0;
public string Title { get; set; } = "";
public List<Ingredient> Ingredients { get; set; } = new();
public string? Instructions { get; set; }
public bool IsValid()
{
bool isValid = false;
if ((false == string.IsNullOrWhiteSpace(Title)) &&
(0 < Ingredients.Count()))
{
isValid = true;
}
return isValid;
}
public void Copy(Recipe other)
{
this.UID = other.UID;
this.Title = other.Title;
this.Ingredients.Clear();
foreach (var ingredient in other.Ingredients)
{
this.Ingredients.Add(ingredient.Clone());
}
}
}