1.JS判断undefined类型

1 if (typeof(reValue) == "undefined") { 2 alert("undefined"); 3 }
2.拉姆达表达式的使用

1 public string getMaintainPersonnalName1(IList<V_MAINTAIN_PERSONNAL> ListPage) 2 { 3 4 ListPage = _vmaintainPersonnalService.GetMaintainPersonnalInfo(); 5 6 string mList = ""; 7 var ListPagetype1 = ListPage.Where(b => b.RepairMan_Type == 1).ToList(); 8 ListPagetype1.Select(b => new { b.NAME, b.RepairMan_ID, b.RepairMan_Type }).Distinct().ToList().ForEach(o => 9 { 10 mList += "<option value="" + o.RepairMan_ID + "" name="" + o.RepairMan_Type + "">" + o.NAME + "</option>"; 11 }); 12 return mList; 13 }
1、where()用法:必须加条件,且返回对象结果。
2、select()用法:(1)(a=>a.Value=="22")加条件查询时,返回bool型结果;
ListPagetype2 是得到集合里type=1的,
ListPagetype2.Select(b => new { b.NAME, b.RepairMan_ID, b.RepairMan_Type }).Distinct() 按多列去重,b=>new{b.xx,b.aa,} 单列只用写b=>b.XX).Distinct就行了
.ForEach(o =>
{
mList += "<option value="" + o.RepairMan_ID + "" name="" + o.RepairMan_Type + "">" + o.NAME + "</option>";
});
去重后的结果遍历
3.JQuery取元素属性值的几种错误写法