Change element to name for ingredient

This commit is contained in:
Jeas0001 2025-04-30 11:04:56 +02:00
parent 15de778225
commit 2596a9e408
4 changed files with 7 additions and 7 deletions

View File

@ -52,7 +52,7 @@ namespace API.BusinessLogic
{
Ingredient ingredient = new Ingredient();
ingredient.Unit = item.Unit;
ingredient.Element = item.Element;
ingredient.Name = item.Name;
ingredient.Amount = item.Amount;
recipe1.Ingredients.Add(ingredient);
}
@ -80,7 +80,7 @@ namespace API.BusinessLogic
{
Ingredient ingredient = new Ingredient();
ingredient.Unit = item.Unit;
ingredient.Element = item.Element;
ingredient.Name = item.Name;
ingredient.Amount = item.Amount;
dish.Ingredients.Add(ingredient);
}

View File

@ -146,9 +146,9 @@ namespace API.BusinessLogic
{
List<ShoppingList> shoppingList = user.ShoppingList;
if (shoppingList.Any(s => s.Name == ingredient.Element))
if (shoppingList.Any(s => s.Name == ingredient.Name))
{
ShoppingList item = shoppingList.Where(s => s.Name == ingredient.Element).FirstOrDefault();
ShoppingList item = shoppingList.Where(s => s.Name == ingredient.Name).FirstOrDefault();
shoppingList.Remove(item);
if (item.Unit == ingredient.Unit)
@ -194,7 +194,7 @@ namespace API.BusinessLogic
else
{
ShoppingList newItem = new ShoppingList();
newItem.Name = ingredient.Element;
newItem.Name = ingredient.Name;
newItem.Amount = ingredient.Amount;
newItem.Unit = ingredient.Unit;
newItem.Checked = false;

View File

@ -8,6 +8,6 @@
public string Unit { get; set; }
public string Element { get; set; }
public string Name { get; set; }
}
}

View File

@ -6,6 +6,6 @@
public string Unit { get; set; }
public string Element { get; set; }
public string Name { get; set; }
}
}