Sql->Linq-> Lambda 相互转换
摘要:Linq 转 SQL 或 Linq 转 Lambda :工具: LinqPadSql 转 Linq to Entity:工具: Linqer
阅读全文
posted @
2014-09-10 12:43
顺风车
阅读(854)
推荐(0)
nopCommerce_3.00-Nop.Core.Caching
摘要:namespace Nop.Core.Caching{ /// /// Cache manager interface /// public interface ICacheManager { /// /// Gets or sets the value associated with the specified key. /// /// Type /// The key of the value to get. /// The value associated with ...
阅读全文
posted @
2014-02-12 18:04
顺风车
阅读(341)
推荐(0)
EF-查看生成的SQL语句
摘要:老版本中:EF 4和EF 3.5 SP1using (var context = new TestDBEntities()){ var query = from p in context.Parents where p.Name == "Lingzhi" select p; ObjectQuery parents = query as ObjectQuery; if (parents != null) { string sql = parents.ToTraceString(); }}Vie...
阅读全文
posted @
2014-01-10 11:52
顺风车
阅读(2394)
推荐(0)
EF-CodeFirst-表关系-延迟/贪婪加载
摘要:表关系建立:http://blog.csdn.net/niewq/article/details/17232321一对多:namespace LckLib.EF.V6.Models{ public class Role { public int ID { get; set; } [MaxLength(20)] [Required] public string RoleName { get; set; } public string Remark { get; set; } public virtua...
阅读全文
posted @
2014-01-10 10:46
顺风车
阅读(483)
推荐(0)
CodeFirst-数据迁移-Migration
摘要:http://www.cnblogs.com/haogj/archive/2012/02/17/2356537.html1.安装最新NuGet2.安装EntityFramework:在程序包管理器控制台中命令 Install-Package EntityFramework。安装的将是最新版本。本人是VS2010,只能安装上最新的EF6.X时才能正常使用Migration数据迁移功能。NuGet没找到办法安装老版本的EF5,如遇大神,请指点。项目中手动引用老版本的EF5[4.4.0.0],可以正常使用CodeFirst,但没办法在NuGet使用Migration功能。3.开启Migration功
阅读全文
posted @
2014-01-09 11:01
顺风车
阅读(263)
推荐(0)
EF中使用存储过程
摘要:1.存储过程使用out参数返回结果存储过程:create or replace procedure PROC_GETSEQ(tbname varchar,ReturnNum out number) is sql_statement varchar2(100);begin sql_statement :='select '||tbname||'_index.nextval from dual'; execute immediate sql_statement into ReturnNum ; end PROC_GETSEQ;EF模型中 添加-函数导入-返回类型集合
阅读全文
posted @
2013-12-10 18:02
顺风车
阅读(582)
推荐(0)
Oracle 视图添加主键
摘要:在Entity Framework中,从数据库生成模型,视图常报无主键。解决办法:为试图添加主键/复合主键create or replace view view_activebudgetamount (activeid,budgetactiveid,flowid,applyyear,activestage,budgettype,amount,constraint view_activebudgetamount_pk primary key (activeid,flowid) rely disable novalidate)as select a.activeid,a.activeid as b
阅读全文
posted @
2013-11-28 15:35
顺风车
阅读(2943)
推荐(0)