随笔分类 -  Linq

摘要:using System; using System.Linq; using System.Xml.Linq; namespace Sample2 { class Program { static void Main(string[] args) { #region 写文件一(生成节点性质的) XD... 阅读全文
posted @ 2017-10-16 14:05 深南大道 阅读(9257) 评论(1) 推荐(0) 编辑
摘要:/*查找XML*/ var filePath = Server.MapPath("~/xml/sample.xml"); XDocument doc = XDocument.Load(filePath); var text1 = doc.Descendants("用户") //定位到节点 .Where(p => p.Element("性别").Value.Co... 阅读全文
posted @ 2017-10-14 20:24 深南大道 阅读(5581) 评论(0) 推荐(0) 编辑
摘要:ALTER VIEW [dbo].[view_TreeLevel] AS WITH cte AS ( SELECT a.ModuleID , a.Module_Name , a.Module_Description , a.Module_FatherID , a.Module_Url , a.Module_Order, 1 Le... 阅读全文
posted @ 2016-12-22 19:50 深南大道 阅读(303) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sample2 { class Program { static void Main(string[] args)... 阅读全文
posted @ 2016-11-28 20:19 深南大道 阅读(605) 评论(0) 推荐(1) 编辑
摘要:/* 以下围绕Person类实现,Person类只有Name和Age两个属性 一.List排序 1.1 List提供了很多排序方法,sort(),Orderby(),OrderByDescending(). */ lstPerson = lstPerson.OrderByDescending(x=>x.Name).ToList(); //降序 lstPerson = lstPerson.Orde... 阅读全文
posted @ 2016-10-21 14:58 深南大道 阅读(393) 评论(0) 推荐(0) 编辑
摘要:static void DeferredQuery() { var names = new List { "Nino", "Alberto", "Juan", "Mike", "Phil" }; var namesWithJ = from n in names ... 阅读全文
posted @ 2015-04-06 11:31 深南大道 阅读(135) 评论(0) 推荐(0) 编辑
摘要:Restriction Operators Where - Simple 1 public void Linq1() { int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var lowNums = from n in numbers where n 0 && p.UnitPrice > 3.00M... 阅读全文
posted @ 2015-04-04 15:16 深南大道 阅读(242) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示