摘要:
/// <summary> /// 两个对象中相同属性赋值,R代表目标实体,T代表数据源实体 /// </summary> public static R MappingObject<R, T>(R newData,T oldData) { if (newData == null) { newDat 阅读全文
摘要:
/// <summary> /// 设置对象中为空的属性值,即对象的所有属性均有值(集合数组属性不能设置) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source">数据源</param> /// <pa 阅读全文
摘要:
1.问题:返回的xml字符串含有 < > 2.使用 using System.Web 中的方法 HttpUtility.HtmlDecode(str) 实现 反转义 解密 HttpUtility.UrlEncode(str)实现转义 加密 阅读全文
摘要:
1.封装被调用库 public delegate string CallBack(string message); public int MyInterfance(CallBack cb) { return cb("张天才"); } 2.使用调用库 int ret = MyInterfance(ca 阅读全文
摘要:
反射+泛型方法 public static bool ObjectIsNullOrEmpty<T>(T t) { foreach (var item in t.GetType().GetProperties()) { if (item.GetValue(t) == null) { return tr 阅读全文