![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
垃圾C#
Ludwig__
这个作者很懒,什么都没留下…
展开
-
C# linq筛选list
private static void ReadT(string str) { List<Info> infoList = new List<Info>(); infoList.Add(new Info() { Id = 1, Name = "woft" }); infoList.Add(new Info() { Id=3,Name="rose"}); infoList.Add(new原创 2021-10-19 13:41:25 · 919 阅读 · 0 评论 -
C# DataTable转List
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); //原创 2021-09-16 10:16:21 · 377 阅读 · 0 评论 -
C# Object 转 DataTable
C# Object 转 DataTablepublic static DataTable ObjectToTable(object obj){try{Type t;if (obj.GetType().IsGenericType){t = obj.GetType().GetGenericTypeDefinition();}else{t = obj.GetType();}if (t == typeof(List<>) ||t == typeof(IEnumerable&原创 2021-09-10 17:31:12 · 3619 阅读 · 0 评论