随笔分类 - Linq
摘要:/// <summary> ///GetAllLesson 的测试 ///</summary> [TestMethod()] public void GetAllLessonTest() { Repository<Lesson> target = new Repository<Lesson>(); Repository<LessonNum> lessonNum = new Repository<LessonNum>(); Repository<UserAccount> tt = new Repository&l
阅读全文
摘要:摘要:通过使用默认的相等比较器对值进行比较返回序列中的非重复元素。var v = (from a in _TaoXueDBEntities.LessonClass join b in _TaoXueDBEntities.Lesson on a.LessonID equals b.LessonID where b.TeacherUIN == uin && b.Status != 0 select b).Distinct();
阅读全文
摘要:同事今天問了一個LINQ下使用多條件比對產生LEFT JOIN的問題,讓我也學到了新東西,特地PO文備忘。這回不寫程式,直接用威到不行的LINQPad做示範。假想的題目是有個員工資料表Employee,Primary Key是DeptId及UserId,除了UserName,另有SubstituteDeptId及SubstituteUserId指向該員工的代理人。公司共有三人,工程部的Jeffre...
阅读全文
摘要:SELECT描述:查询顾客的公司名、地址信息 查询句法: var 构建匿名类型1 = from c in ctx.Customers select new { 公司名 = c.CompanyName, 地址 = c.Address };描述:查询职员的姓名和雇用年份 查询句法: var 构建匿名类型2 = from emp in ctx.Employees select new { ...
阅读全文
摘要:vs2010 -EF4.0 数据层的实现: 通过反射返回泛型的工厂
阅读全文
摘要:EF4.0中Entities执行sql语句
阅读全文
摘要:Linq如: var v = from l in _dal.Share where l.PingcoId == pingcoId && (l.CreateTime.Date == DateTime.Now.Date) select l; return v.ToList();会报错:LINQ to Entities 不支持指定的类型成员“Date”。改成这样O...
阅读全文
摘要:
Linq之group by 学习 使用:linq查询工具可以帮助深刻理解!
阅读全文
