我正在使用实体数据模型向导/ Code First From Database选项。
我想为下面的每个表创建一个Model类(Action,ActionDefs等)。我究竟做错了什么?我得到以下内容:
public partial class MyDBContext : DbContext
{
public MyDBContext()
: base("name=MyDBContext")
{
}
public virtual DbSet<Action> Actions { get; set; }
public virtual DbSet<ActionDef> ActionDefs { get; set; }
public virtual DbSet<ActionMethod> ActionMethods { get; set; }
public virtual DbSet<Activation> Activations { get; set; }
public virtual DbSet<Address> Addresses { get; set; }
public virtual DbSet<AdHocComCall> AdHocComCalls { get; set; }
public virtual DbSet<AdHocComFunction> AdHocComFunctions { get; set; }
public virtual DbSet<AdHocComParam> AdHocComParams { get; set; }
public virtual DbSet<AdHocDetail> AdHocDetails { get; set; }
public virtual DbSet<AdHocError> AdHocErrors { get; set; }
public virtual DbSet<AdHocGroup> AdHocGroups { get; set; }
public virtual DbSet<AdHocJoin> AdHocJoins { get; set; }
public virtual DbSet<AdHocQuery> AdHocQueries { get; set; }
public virtual DbSet<Affiliation> Affiliations { get; set; }
public virtual DbSet<Answer> Answers { get; set; }
public virtual DbSet<audiobook> audiobooks { get; set; }
public virtual DbSet<Audit> Audits { get; set; }
public virtual DbSet<AutoLinkException> AutoLinkExceptions { get; set; }
public virtual DbSet<AutoLinkQueue> AutoLinkQueues { get; set; }
public virtual DbSet<Billing> Billings { get; set; }
public virtual DbSet<BillingExportHP> BillingExportHPs { get; set; }
public virtual DbSet<BillingMethod> BillingMethods { get; set; }
public virtual DbSet<CAM_IRAAccountUpdateQueue> CAM_IRAAccountUpdateQueue { get; set; }
public virtual DbSet<CaseDetail1> CaseDetail1 { get; set; }
public virtual DbSet<CaseDetail2> CaseDetail2 { get; set; }
public virtual DbSet<CFGDate> CFGDates { get; set; }
public virtual DbSet<CfgGeneric> CfgGenerics { get; set; }
public virtual DbSet<CFGNumeric> CFGNumerics { get; set; }
public virtual DbSet<CFResult> CFResults { get; set; }
public virtual DbSet<CFResultsRaw> CFResultsRaws { get; set; }
public virtual DbSet<Client> Clients { get; set; }
答案 0 :(得分:0)
我想通了,但我不确定它是如何运作的。 1)Code First From Database选项。 2)删除上方 3)来自数据库的EF Designer 4)删除上方 5)再次做#1。