我不确定如何在Entity Framework中设置此数据库。 我有这些模特:
public class Recipe
{
public int RecipeId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Difficulty { get; set; }
public IEnumerable<Ingredient> Ingredients { get; set; }
}
public class Ingredient
{
public int IngredientId { get; set; }
public string Name { get; set; }
public IEnumerable<Recipe> Recipes { get; set; }
}
但我需要添加度量(单位)和金额。它应该是升和克。我应该在哪里添加这个?我现在的想法是:
稍后将在ASP.NET MVC项目中显示所有内容。