动态传入泛型类

摘要: 有这样的场景,对于泛型参数T需要在运行时传入,如下面的T 用一般方式是不可行的,因为T是在编译时确定的。 可以用反射来实现。 阅读全文
posted @ 2018-07-03 18:00 傍晚雨 阅读(501) 评论(0) 推荐(0)

在EF6.0中打印数据库操作日志

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace EFLogging { class Program { ... 阅读全文
posted @ 2018-07-03 17:43 傍晚雨 阅读(255) 评论(0) 推荐(0)

EF记录统一添加创建,修改时间

摘要: We’ll add the DateCreated, UserCreated, DateModified and UserModified fields to each entity by creating a BaseEntity.cs class. Each entity that you wa 阅读全文
posted @ 2018-07-03 17:39 傍晚雨 阅读(369) 评论(0) 推荐(0)