Dictionary<string, object> dic = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); dic.Keys.Contains("Key", StringComparer.OrdinalIgnoreCase);…
public static class WebExtension { public static T Decode<T>(this RequestBase res) { Type type = res.GetType(); // For each property of this object, html decode it if it is of type string foreach (PropertyInfo propertyInfo in type.GetProperties()) {…
Dictionary<string, object> dcic = JsonHelper.DataRowFromJSON(resultdepth); foreach (var depthkey in dcic.Keys) { if (depthkey.Contains("data")) { Dictionary<string, object> Ddata = (Dictionary<string, object>)dcic["data&qu…
Tuple<int, int> Dictionary<string, object>妙用…
JavaScriptSerializer jss = new JavaScriptSerializer(); Dictionary<string, object> dict = new Dictionary<string, object>(); string strDATAJSON = ""; dict.Add("AA", "00"); dict.Add("BB", "00"); d…
MVC object htmlAttributes:new {style="color:red",width="12px",height="10px"}. IDictionary<string, object> htmlAttributes:new Dictionary<string, object>{{"id","test"},{"style","fo…
一直对LINQ简洁高效的语法青睐有加,对于经常和资料库,SQL语法打交道的C#开发者来说,LINQ无疑是一个非常不错的选择,当要在List<T>(T为一个普通对象)集合中查找满足某些条件的某个对象时,写成 form t in T where t. Property1 == "A" && t. Property2== "B" …select t或者写成T.Where(t=>t. . Property1 == "A"…
IModelBinder的学习不算深入,现在用它来实现一个json转Dictionary<string, string> 一.原始json转Dictionary<string, string> 如果不用IModelBinder,那么将Json字符串转换为Dictionary<string, string>的代码写法是: /// <summary> /// 手动Json转Dictionary /// </summary> /// <param…
public class ModelConvertHelper<T> where T : new() {// 此处一定要加上new() public static IList<T> ConvertToModel(DataTable dt) { IList<T> ts = new List<T>();// 定义集合 Type type = typeof(T); // 获得此模型的类型 string tempName = ""; foreac…
分页查询 String sql = "返回所有符合条件记录的待分页SQL语句"; int start = (page - 1) * limit + 1; int end = page * limit; sql = "select * from (select fulltable.*, ROWNUM RN from (" + sql + ") fulltable where ROWNUM <= " + end + ") where…