回答问题:我解决了我的问题。它与提出的重复问题不同。
下面是我模型的一些属性。在数据库生成的结果中,一些列具有带下划线(InternalWorkflow_Id)和其他的名称 - 没有下划线(InitiatorId)。为什么? 我可以通过attributs或流畅的api来纠正它,但我不明白为什么它默认以不同的方式进行。
public Guid? ParentDocflowId { set; get; }
public Docflow ParentDocflow { set; get; }
public Guid InitiatorId { set; get; }
public Participant Initiator { set; get; }
public Guid RecipientId { set; get; }
public Participant Recipient { set; get; }
private Guid OwnerId { get; set; }
public Participant Owner { get; set; }
private Guid? InternalWorkflowId { get; set; }
public InternalWorkflow InternalWorkflow { get; set; }
private Guid StateId { get; set; }
public Type State { get; set; }
private Guid ClientAppId { get; set; }
public Type ClientApp { get; set; }
private Guid? ScopeVisibilityId { get; set; }
public Type ScopeVisibility { get; set; }
CreateTable(
"dbo.Docflows",
c => new
{
Id = c.Guid(nullable: false),
WorkflowId = c.Guid(nullable: false),
Name = c.String(),
IsReviewed = c.Boolean(nullable: false),
IsArchived = c.Boolean(nullable: false),
DateCreated = c.DateTime(nullable: false),
DateClosed = c.DateTime(nullable: false),
DateOff = c.DateTime(nullable: false),
DocflowTemplateId = c.Guid(nullable: false),
ParentDocflowId = c.Guid(),
InitiatorId = c.Guid(nullable: false),
RecipientId = c.Guid(nullable: false),
ClientApp_Id = c.Guid(),
InternalWorkflow_Id = c.Guid(),
Owner_Id = c.Guid(),
ScopeVisibility_Id = c.Guid(),
State_Id = c.Guid(),
})
答案 0 :(得分:0)
我解决了我的问题。它与提出的重复问题不同。 我的例子中的问题是modificator" private"对于领域。因此EF不了解它们并通过命名约定创建列。