Я новичок в коде и выведен из контекста БД. Вот отрывок из моей модели.код сначала много-много заданное имя таблицы
[Table("pm_Material")]
public class Material
{
public Material()
{
this.ProductionStepLogs = new HashSet<ProductionStepLog>();
}
[Key]
public int MaterialId { get; set; }
public int MaterialTypeId { get; set; }
public string Description { get; set; }
public decimal CostRate { get; set; }
public virtual MaterialType MaterialType { get; set; }
public virtual ICollection<ProductionStepLog> ProductionStepLogs { get; set; }
}
[Table("pm_ProductionStepLog")]
public class ProductionStepLog
{
public ProductionStepLog()
{
this.Materials = new HashSet<Material>();
}
[Key]
public System.Guid ProductionStepLogId { get; set; }
public int ProductionStepId { get; set; }
public System.Guid ProductId { get; set; }
public Nullable<System.DateTime> BeginStep { get; set; }
public Nullable<System.DateTime> EndStep { get; set; }
public int UserId { get; set; }
public virtual Product Product { get; set; }
public virtual ProductionStep ProductionStep { get; set; }
public virtual ICollection<Material> Materials { get; set; }
}
Создание БД работает отлично, но я хочу, чтобы указать имя автоматически созданным многие-ко-многим «таблицы ProductionStepLogMaterials», используя [Table («pm_ProductionStepLogMaterials»)].
Возможно ли это?
только имя ? – NSGaga
Было ли это полезно для вас? – MikroDel
@NSGaga, Да, просто имя. – float