ممنونم از پاسختون
بزرگوار دوباره همون فیلد تکرار شد
migrationBuilder.CreateTable(
name: "products",
columns: table => new
{
ProductID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
ProductTypeID = table.Column<int>(type: "int", nullable: false),
ProductTypesProductTypeID = table.Column<int>(type: "int", nullable: true),
ProductAbilityID = table.Column<int>(type: "int", nullable: false)
},
ProductTypesProductTypeID این فیلد دوباره تکرار شده
public partial class ProductAbility
{
[Key]
public int ProductAbilityID { get; set; }
[Display(Name = "قابلیت")]
public string Ability { get; set; }
[DataType(DataType.MultilineText)]
[Display(Name = "محتوا")]
public String Body { get; set; }
[DataType(DataType.Date)]
[Display(Name = "تاریخ")]
public DateTime ReleaseDate { get; set; }
public ICollection<Products> listProductAbility { get; set; }
}
public partial class ProductTypes
{
[Key]
public int ProductTypeID { get; set; }
[Display(Name = "نوع محصول")]
public string Title { get; set; }
[DataType(DataType.Date)]
[Display(Name = "تاریخ")]
public DateTime ReleaseDate { get; set; }
public ICollection<Products> listProductTypes { get; set; }
}
public partial class Products
{
[Key]
public int ProductID { get; set; }
[Display(Name = "محصول")]
public string Title { get; set; }
[ForeignKey("ProductTypeIDRef")]
public int ProductTypeID { get; set; }
public ProductTypes ProductTypes { get; set; }
[ForeignKey("ProductAbilityIDRef")]
public int ProductAbilityID { get; set; }
public ProductAbility ProductAbility { get; set; }
}