zoukankan      html  css  js  c++  java
  • C# EF添加ADO.NET实体数据模型时,产生.Desiger.cs文件为空

    // T4 code generation is enabled for model 'D:DKX4003workVWFC_CCSSrcCCG-branchCCGSPBOCOne-FCACUPVWFC.IT.CUP.DALCupCreditQueryModel.edmx'. 
    // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
    // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
    // is open in the designer.
    
    // If no context and entity classes have been generated, it may be because you created an empty model but
    // have not yet chosen which version of Entity Framework to use. To generate a context class and entity
    // classes for your model, open the model in the designer, right-click on the designer surface, and
    // select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
    // Item...'.

    原因:添加实体时“代码生成策略”  的值是为 “T4”

    解决办法:在”关系图“空白处,即.edmx文件里的空白处右键选属性,找到“代码生成策略”,将值“T4”改为“Legacy ObjectContext”,保存后.Desiger.cs文件中就生成代码了。

    同时删除多余的.Context.tt和.tt文件。

  • 相关阅读:
    石头的用途
    [转] Analysis: Khronos and OpenGL ARB merge
    ★○值得你我珍藏一世的80句话○★
    PasswordStrength 控件
    NumericUpDownExtender 控件
    ReorderList控件
    Nobot控件拒绝机器人行为
    PopupControlExtender控件
    PagingBulletedList 控件学习
    MutuallyExlcusiveCheckBox控件
  • 原文地址:https://www.cnblogs.com/hofmann/p/11732387.html
Copyright © 2011-2022 走看看