1. InvokeMember 1.1 InvokeMember Parameters 1.1.1 name 1.1.2 invokeAttr 1.1.3 binder 1.1.4 target 1.1.5 args 1.1.6 Return 1.1.7 BindingFlags 1.1.8 Based on Visibility 1.1.9 Case Sensitivity and Search Hierarchy 1.1.10 Specify Operations on Members 1.2 Practica…

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

1,InvokeMember 1.1 InvokeMember 参数 1.1.1 name 1.1.2 invokeAttr 1.1.3 binder 1.1.4 target 1.1.5 args 1.1.6 返回 1.1.7 BindingFlags 1.1.8 根据是否公开 1.1.9 大小写和搜索层次 1.1.10 指定对成员进行何种操作 1.2 实践使用 InvokeMember 和成员的重载方法 1.2.1 静态方法和实例方法 1.2.2 方法参数 1.2.3 字段属性 1.2.4 默认成员 1.2.5…

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

1. Assignment and Reading of Property Fields 2. Custom Attributes and Attribute Lookup 2.1 Specifications and Custom Attributes 2.1.1 Defining Attributes 2.1.2 Restricting Attribute Usage 2.1.3 Attribute Constructors and Properties 2.2 Retrieving Attributes 2.…

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

1,属性字段的赋值和读值 2,自定义特性和特性查找 2.1 特性规范和自定义特性 2.1.1 定义特性 2.1.2 限制特性的使用 2.1.3 特性的构造函数和属性 2.2 检索特性 2.2.1 方式一 2.2.2 方式二 3,设计一个数据验证工具 3.1 定义抽象验证特性类 3.2 实现多个自定义验证特性 3.3 检查特性是否属于自定义验证特性 3.4 检查属性值是否符合自定义验证特性的要求 3.5 实现解析功能 3.6 编写一个模型类 3.7 执行验证 3.8 总结 [......] 继续阅读

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

1. Writing a Dependency Injection Framework 1.1 Routing Index 1.1.1 Checking if the Controller exists 1.1.2 Checking if the Action exists 1.2 Dependency Instantiation 1.3 Instantiation of Type, Dependency Injection, Calling Method 2. Writing Controllers and Pa…

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

1,编写依赖注入框架 1.1 路由索引 1.1.1 判断控制器 Controller 是否存在 1.1.2 判断 Action 是否存在 1.2 依赖实例化 1.3 实例化类型、依赖注入、调用方法 2,编写控制器和参数类型 2.1 编写类型 2.2 实现控制器 3,实现低配山寨 ASP.NET Core [......] 继续阅读

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

1. MemberInfo 1.1 Exercise - Get Type Members and Output Information 1.2 MemberType Enumeration 1.3 MemberInfo Get Member Method and Call 1.4 Get Inherited Method Information (DeclaringType and ReflectedType) 2. Reflection from IL 2.1 Get Properties Construct …

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

1,MemberInfo 1.1 练习-获取类型的成员以及输出信息 1.2 MemberType 枚举 1.3 MemberInfo 获取成员方法并且调用 1.4 获取继承中方法的信息(DeclaringType 和 ReflectedType) 2,从 IL 看反射 2.1 获取属性的构造 2.2 属性的方法 3,方法操作 3.1 各种方式调用方法 3.1.1 调用方法 3.1.2 获取参数列表 3.1.3 获取重载方法 [......] 继续阅读

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

A to B, C await (from e in _context.Equip join c in _context.Ycp on e.EquipNo equals c.EquipNo into j1 join x in _context.Yxp on e.EquipNo equals x.EquipNo into j2 select[......]继续阅读

2020年1月10日 2条评论 6816点热度 10人点赞 痴者工良 阅读全文

A对B、C await (from e in _context.Equip join c in _context.Ycp on e.EquipNo equals c.EquipNo into j1 join x in _context.Yxp on e.EquipNo equals x.EquipNo into j2 select new[......]继续阅读

2020年1月10日 2条评论 6814点热度 10人点赞 痴者工良 阅读全文

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.1.5 Activator.CreateInstance() Performance 1.2 ConstructorInfo.Invoke() 2. Instantiating Delegates 3. Instantiati…

2020年1月5日 0条评论 136点热度 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.Invoke() 2,实例化委托 3,实例化泛型类型 3.1 实例化泛型 3.2 构造封闭泛型类型以及反转 3.2.1 构造封闭构造函数 3.2.2 去除泛型类型的参数类型绑定 3.2.3 实践一下 [......] 继续阅读

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

1. Getting Type Information 1.1 Base Classes and Interfaces of Types 1.1.1 Base Class 1.1.2 Getting Implemented Interfaces 1.1.3 Getting Generic Interfaces 1.2 Getting Property and Field Members 1.2.1 Constructors 1.2.2 Properties 1.2.3 Fields 1.2.4 Methods 1.…

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

1,获取类型的信息 1.1 类型的基类和接口 1.1.1 基类 1.1.2 获取实现的接口 1.1.3 获取泛型接口 1.2 获取属性、字段成员 1.2.1 构造函数 1.2.2 属性 1.2.3 字段 1.2.4 方法 1.2.5 事件 1.2.6 成员 [......] 继续阅读

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

1. Overview of Reflection Usage 1.1 What is Reflection 1.2 What can Reflection do 1.3 Type Class 1.4 Categories of Reflection Usage 1.4 Type Some Common Properties 2. Obtaining Type 2.1 Getting Type 2.2 Array Type Generating Array Type Obtaining Array Type Get…

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

1,反射的使用概述 1.1 什么是反射 1.2 反射可以做什么 1.3 Type 类 1.4 反射使用归类 1.4 Type 一些常用属性 2,获取 Type 2.1 获取 Type 类型 2.2 数组 Type 生成数组 Type 获取数组 Type 获取数组的元素类型、维数 矩形数组(交错数组) 2.3 嵌套类型 2.4 泛型 Type 泛型信息 泛型相关 2.5 方法的参数和 ref / out [......] 继续阅读

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

1. Introduction 1.1 About Reflection and Attributes 2. Assembly Operations 2.1 Getting the Assembly Object 2.1.1 Runtime Getting Assemblies 2.1.2 Usage Methods 2.1.3 Loading Assemblies from Files 2.1.4 Usage Methods 2.2 Assembly Usage 2.2.1 Getting the Fully Q…

2019年12月29日 2条评论 86点热度 0人点赞 痴者工良 阅读全文

1. 说明 1.1 关于反射、特性 2. 程序集操作 2.1 获取 程序集对象(Assembly) 2.1.1 运行时获取程序集 2.1.2 使用方法 2.1.3 从文件加载程序集 2.1.4 使用方法 2.2 Assembly 使用 2.2.1 获取程序集完全限定名称 2.2.2 AssemblyName 2.3 获取程序集的方式 2.3.1 Assembly.Load() 2.3.2 Assembly.LoadFile() [......] 继续阅读

2019年12月29日 2条评论 3787点热度 0人点赞 痴者工良 阅读全文

Through reflection, after obtaining the property names and attributes, the next step is to retrieve the values of the properties. static void Main(string[] args) { Test test = new Test() { A = 13510377651, B = 1,[......]继续阅读

2019年12月29日 0条评论 3836点热度 2人点赞 痴者工良 阅读全文

通过反射获取到属性名称以及特性后,要获取属性的值。 static void Main(string[] args) { Test test = new Test() { A = 13510377651, B = 1, C = 13510399648 }; Type type = test.GetType(); // 获取类的属性列表[......]继续阅读

2019年12月29日 0条评论 3818点热度 2人点赞 痴者工良 阅读全文
1373839404154