摘要: 在EF架构中,我们的数据库注释不会被自动映射到EDMX模型上,而模型的说明也不会自己在生成的SQL语句上体现,我们需要手动做一下设置才行。首先分两步走,第一步Data First环境下,将数据库注释添加到实体类;第二步 Code First环境下,将实体类注释,输出到SQL语句上。下面是实现方法:第一 数据库注释添加到实体类从数据库更新模型后,假设为"D:\EF_project1\Model1.edmx"下载工具http://eftsqldocgenerator.codeplex.com/,执行相关命令:EFTSQLDocumentation.Generator.exe - 阅读全文
posted @ 2012-11-01 10:36 Ruiky 阅读(1519) 评论(1) 推荐(0) 编辑
摘要: void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty){ if (edmProperty.Documentation != null && edmProperty.Documentation.Summary != null) { WriteProperty(Accessibility.ForProperty(edmProperty), code.Escape(edmProperty.Documentation.Summary), ... 阅读全文
posted @ 2012-11-01 10:19 Ruiky 阅读(4458) 评论(3) 推荐(0) 编辑