使用继承的的方式,缺点是添加功能是,上下层都需要改变; 同时为了避免为外界透露细节; 松耦合,避免两者出现静态的联系; 有接口和实现如下: public interface ITest { void A(); void B(); }[......]继续阅读

2020年5月8日 0条评论 3178点热度 0人点赞 痴者工良 阅读全文

Using inheritance has the drawback that adding functionality requires changes in both the upper and lower layers. At the same time, it is necessary to[......] 继续阅读

2020年5月8日 0条评论 72点热度 0人点赞 痴者工良 阅读全文

1,实例化类型 1.1 Activator.CreateInstance() 1.1.1 简单类型 1.1.2 简单类型的构造函数 1.1.3 object 1.1.4 故意出错 1.1.5 Activator.CreateInstance() 性能 1.2 ConstructorInfo.Inv[......] 继续阅读

2020年1月5日 0条评论 3307点热度 0人点赞 痴者工良 阅读全文

1. Instantiating Types 1.1 Activator.CreateInstance() 1.1.1 Simple Types 1.1.2 Constructors of Simple Types 1.1.3 object 1.1.4 Intentional Error 1.[......] 继续阅读

2020年1月5日 0条评论 108点热度 0人点赞 痴者工良 阅读全文

.NET Core 获取数据库上下文实例的方法和配置连接字符串 [TOC] 假设数据库就两个表:User、Blogs, 模型类如下 public class User { public int Id { get; set; } public strin[......]继续阅读

2019年12月15日 1条评论 4129点热度 4人点赞 痴者工良 阅读全文

.NET Core Method for Obtaining Database Context Instance and Configuring Connection Strings [TOC] Assuming the database has two tables: User and Blogs[......] 继续阅读

2019年12月15日 1条评论 108点热度 4人点赞 痴者工良 阅读全文