会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
首页
管理
上一页
1
···
6
7
8
9
10
11
12
13
14
···
33
下一页
2021年8月5日
两个对象中相同属性赋值
摘要: /// <summary> /// 两个对象中相同属性赋值,R代表目标实体,T代表数据源实体 /// </summary> public static R MappingObject<R, T>(R newData,T oldData) { if (newData == null) { newDat
阅读全文
posted @ 2021-08-05 15:20 超级驼鹿
阅读(346)
评论(0)
推荐(0)
2021年7月8日
保证对象里所有属性都有值
摘要: /// <summary> /// 设置对象中为空的属性值,即对象的所有属性均有值(集合数组属性不能设置) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source">数据源</param> /// <pa
阅读全文
posted @ 2021-07-08 08:42 超级驼鹿
阅读(108)
评论(0)
推荐(0)
2021年6月17日
C# xml 转义 < >
摘要: 1.问题:返回的xml字符串含有 < > 2.使用 using System.Web 中的方法 HttpUtility.HtmlDecode(str) 实现 反转义 解密 HttpUtility.UrlEncode(str)实现转义 加密
阅读全文
posted @ 2021-06-17 11:59 超级驼鹿
阅读(1780)
评论(0)
推荐(0)
2021年6月10日
C# 使用委托实现回调功能
摘要: 1.封装被调用库 public delegate string CallBack(string message); public int MyInterfance(CallBack cb) { return cb("张天才"); } 2.使用调用库 int ret = MyInterfance(ca
阅读全文
posted @ 2021-06-10 18:26 超级驼鹿
阅读(111)
评论(0)
推荐(0)
2021年5月26日
C# 判断对象里所有属性的值是否存在空值
摘要: 反射+泛型方法 public static bool ObjectIsNullOrEmpty<T>(T t) { foreach (var item in t.GetType().GetProperties()) { if (item.GetValue(t) == null) { return tr
阅读全文
posted @ 2021-05-26 10:34 超级驼鹿
阅读(1186)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
33
下一页
/*