今天来讲解反射的应用:

一、反射是什么?

简诉一下,反射就是.Net Framework 的一个帮助类库,可以获取并使用metadata(元数据清单);说的通俗易懂点,就是不用通过引用,仍然可以使用其他层的类。

二、让我们建一个项目来开始操作吧!!!

1、建立一个控制台应用程序,并建立一个类库,类库里添加一个用户类。

public class UsersInfo
{
public string Name { get; set; }
public bool Sex { get; set; }
public void CommonMethod()
{
Console.WriteLine("我是普通方法");
}
public void ParameterMethod(string name)
{
Console.WriteLine("我是带参数方法,我叫"+name);
} public void OverrideMethod(int age)
{
Console.WriteLine("我是重载方法,我今年"+age);
}
public void OverrideMethod(string name)
{
Console.WriteLine("我是重载方法,我叫" + name);
}
public void GenericityMethod<T>(T t)
{
Console.WriteLine("我是泛型方法方法,类型是"+typeof(T));
}
private void PrivateMethod()
{
Console.WriteLine("我是私有方法");
}
public static void StaticMethod()
{
Console.WriteLine("我是静态方法");
}
}

2、利用反射获取类库,和类

  • 第一步引用命名空间
  • 第二步,动态加载类库,写要获取类库的绝对路径
  • 第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name); }
}
}
}

3、利用反射获取属性,和属性类型

  • 遍历类型的属性集合
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
}
} }
}
}

三、获取方法(方法类型比较多,所以单独做个模块来写)

  • 创建一个符合类型的对象
  • 指定要获取的方法名称
  • 创建方法,第一个参数,对象,第二个参数,没有则为空

1、获取普通方法

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
}
Console.WriteLine("***********************普通方法*****************************");
object oUser = Activator.CreateInstance(type);//创建一个符合类型的对象
MethodInfo method = type.GetMethod("CommonMethod");//指定要获取的方法名称
method.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,没有则为空
} }
}
}

2、获取带参数的方法

  • 指定要获取的方法名称
  • 创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
} Console.WriteLine("***********************普通方法*****************************");
object oUser = Activator.CreateInstance(type);//创建一个符合类型的对象
MethodInfo commonMethod = type.GetMethod("CommonMethod");//指定要获取的方法名称
commonMethod.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,没有则为空 Console.WriteLine("***********************带参数的方法*****************************");
MethodInfo parameterMethod = type.GetMethod("ParameterMethod");//指定要获取的方法名称
parameterMethod.Invoke(oUser, new object[] { "餐餐"});//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
} }
}
}

3、重载方法

  • 指定要获取的方法名称,和参数类型
  • 创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
} Console.WriteLine("***********************普通方法*****************************");
object oUser = Activator.CreateInstance(type);//创建一个符合类型的对象
MethodInfo commonMethod = type.GetMethod("CommonMethod");//指定要获取的方法名称
commonMethod.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,没有则为空 Console.WriteLine("***********************带参数的方法*****************************");
MethodInfo parameterMethod = type.GetMethod("ParameterMethod");//指定要获取的方法名称
parameterMethod.Invoke(oUser, new object[] { "餐餐"});//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法int参数*****************************");
MethodInfo overrideMethodInt = type.GetMethod("OverrideMethod",new Type[] { typeof(int)});//指定要获取的方法名称,和参数类型
overrideMethodInt.Invoke(oUser, new object[] { 18 });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法string参数*****************************");
MethodInfo overrideMethodStrint = type.GetMethod("OverrideMethod", new Type[] { typeof(string) });//指定要获取的方法名称,和参数类型
overrideMethodStrint.Invoke(oUser, new object[] { "餐餐" });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
} }
}
}

4、泛型方法

  • 指定要获取的方法名称,和泛型参数类型
  • 创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
} Console.WriteLine("***********************普通方法*****************************");
object oUser = Activator.CreateInstance(type);//创建一个符合类型的对象
MethodInfo commonMethod = type.GetMethod("CommonMethod");//指定要获取的方法名称
commonMethod.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,没有则为空 Console.WriteLine("***********************带参数的方法*****************************");
MethodInfo parameterMethod = type.GetMethod("ParameterMethod");//指定要获取的方法名称
parameterMethod.Invoke(oUser, new object[] { "餐餐"});//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法int参数*****************************");
MethodInfo overrideMethodInt = type.GetMethod("OverrideMethod",new Type[] { typeof(int)});//指定要获取的方法名称,和参数类型
overrideMethodInt.Invoke(oUser, new object[] { 18 });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法string参数*****************************");
MethodInfo overrideMethodStrint = type.GetMethod("OverrideMethod", new Type[] { typeof(string) });//指定要获取的方法名称,和参数类型
overrideMethodStrint.Invoke(oUser, new object[] { "餐餐" });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************泛型方法*****************************");
MethodInfo genericityMethod = type.GetMethod("GenericityMethod").MakeGenericMethod(new Type[] {typeof(int)});//指定要获取的方法名称,和泛型参数类型
genericityMethod.Invoke(oUser, new object[] { 123 });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
} }
}
}

5、私有方法

  • 指定要获取的方法名称,指明是父类的私有方法
  • 创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//第一步引用命名空间
namespace Reflection
{
class Program
{
static void Main(string[] args)
{
{
Console.WriteLine("***********************获取类*****************************");
//第二步,动态加载类库,写要获取类库的绝对路径
Assembly assembly= Assembly.LoadFile(@"C:\Users\炸天张缺缺\Desktop\Reflection\Reflection.Model\bin\Debug\Reflection.Model.dll");
//第三步,动态获取类型,写类库的名称和类的名称,不需要后缀
Type type = assembly.GetType("Reflection.Model.UsersInfo");
Console.WriteLine(type.Name);
Console.WriteLine("***********************获取属性*****************************");
//遍历类型的属性集合
foreach (var item in type.GetProperties())
{
Console.WriteLine(item.Name+" "+item.PropertyType);
} Console.WriteLine("***********************普通方法*****************************");
object oUser = Activator.CreateInstance(type);//创建一个符合类型的对象
MethodInfo commonMethod = type.GetMethod("CommonMethod");//指定要获取的方法名称
commonMethod.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,没有则为空 Console.WriteLine("***********************带参数的方法*****************************");
MethodInfo parameterMethod = type.GetMethod("ParameterMethod");//指定要获取的方法名称
parameterMethod.Invoke(oUser, new object[] { "餐餐"});//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法int参数*****************************");
MethodInfo overrideMethodInt = type.GetMethod("OverrideMethod",new Type[] { typeof(int)});//指定要获取的方法名称,和参数类型
overrideMethodInt.Invoke(oUser, new object[] { 18 });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************重载方法string参数*****************************");
MethodInfo overrideMethodStrint = type.GetMethod("OverrideMethod", new Type[] { typeof(string) });//指定要获取的方法名称,和参数类型
overrideMethodStrint.Invoke(oUser, new object[] { "餐餐" });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************泛型方法*****************************");
MethodInfo genericityMethod = type.GetMethod("GenericityMethod").MakeGenericMethod(new Type[] {typeof(int)});//指定要获取的方法名称,和泛型参数类型
genericityMethod.Invoke(oUser, new object[] { 123 });//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型 Console.WriteLine("***********************泛型方法*****************************");
MethodInfo privateMethod = type.GetMethod("PrivateMethod",BindingFlags.Instance|BindingFlags.NonPublic);//指定要获取的方法名称,指明是父类的私有方法
privateMethod.Invoke(oUser,null);//创建方法,第一个参数,对象,第二个参数,是一个object对象数组,写对应的参数类型
} }
}
}

6、静态方法

 Console.WriteLine("***********************静态方法*****************************");
MethodInfo staticMethod = type.GetMethod("StaticMethod");//指定要获取的方法名称
staticMethod.Invoke(null, null);//不需要实例化,所以第一个可以不写,为空

四、小扩展,反射书写ORM(请原谅我没有注释)

接口

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace NineMonthExam.IDAL
{
public interface IEFHelpers<T> where T:class
{
bool Add(T t);
bool Remove(int id);
bool Edit(T t);
List<T> GetAll();
}
}

dbhelp类

using NineMonthExam.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Data.SqlClient;
using NineMonthExam.Model; namespace NineMonthExam.DAL
{
public class DBHelpers<T> : IEFHelpers<T> where T : BaseModel
{
private static Type type;
private static string typeName;
private static string nameStr;
private static string noIdNameStr;
private static string sql = "";
private static StringBuilder addStr = new StringBuilder();
private static StringBuilder getStr = new StringBuilder();
private static StringBuilder removeStr = new StringBuilder();
private static StringBuilder modify = new StringBuilder();
private static StringBuilder modifyStr = new StringBuilder();
private static string conStr=ConfigurationManager.ConnectionStrings["conStr"].ConnectionString;
static DBHelpers()
{
type = typeof(T);
typeName = type.Name;
nameStr =string.Join(",", type.GetProperties().Select(m=>m.Name));
noIdNameStr = string.Join(",", type.GetProperties().Where(m=>!m.Name.Equals("Id")).Select(m => m.Name));
addStr.Append($@"insert into {typeName} ({noIdNameStr}) values ({string.Join(",", type.GetProperties().Where(m => !m.Name.Equals("Id")).Select(m =>$"@{m.Name}"))})");
getStr.Append($@"select {nameStr} from {typeName}");
removeStr.Append($@"delete from {typeName}");
modify.Append($@"update {typeName} set");
foreach (var item in type.GetProperties().Where(m => !m.Name.Equals("Id")).Select(m => m.Name))
{
modify.Append($@" {item}=@{item},");
}
string qian = modify.ToString();
qian = qian.Remove(qian.LastIndexOf(','));
modifyStr.Append(qian);
} public bool Add(T t)
{
SqlParameter[] parameters = type.GetProperties().Where(m => !m.Name.Equals("Id")).Select(m => new SqlParameter($"@{m.Name}", m.GetValue(t) ?? DBNull.Value)).ToArray();
sql = addStr.ToString();
using (SqlConnection conn = new SqlConnection(conStr))
{
conn.Open();
SqlCommand com = new SqlCommand(sql,conn);
com.Parameters.AddRange(parameters);
return com.ExecuteNonQuery() > 0;
}
} public bool Edit(T t)
{
SqlParameter[] parameters = type.GetProperties().Select(m => new SqlParameter($"@{m.Name}", m.GetValue(t)??DBNull.Value)).ToArray();
string edit=$" where Id = @{type.GetProperty("Id").Name}";
sql = modifyStr.ToString()+ edit;
using (SqlConnection conn = new SqlConnection(conStr))
{
conn.Open();
SqlCommand com = new SqlCommand(sql, conn);
com.Parameters.AddRange(parameters);
return com.ExecuteNonQuery() > 0;
}
}
private T GetT(SqlDataReader sdr)
{
T obj = Activator.CreateInstance(type) as T;
foreach (var item in type.GetProperties())
{
if (sdr[item.Name].GetType() != typeof(DBNull))
{
item.SetValue(obj, sdr[item.Name]);
}
else
{
item.SetValue(obj, null); }
}
return obj;
}
public List<T> GetAll()
{
sql = getStr.ToString();
using (SqlConnection conn = new SqlConnection(conStr))
{
conn.Open();
SqlCommand com = new SqlCommand(sql, conn);
SqlDataReader reader =com.ExecuteReader();
List<T> list = new List<T>();
while (reader.Read())
{
list.Add(GetT(reader));
}
return list;
}
} public bool Remove(int id)
{
string del=$" where Id = {id}";
sql = removeStr.ToString()+del;
using (SqlConnection conn = new SqlConnection(conStr))
{
conn.Open();
SqlCommand com = new SqlCommand(sql, conn);
return com.ExecuteNonQuery() > 0;
}
}
}
}

五、结束语:所有的成功都离不开努力,不要用不公平掩饰你不努力的样子

所有的成功都离不开努力,不要用不公平掩饰你不努力的样子

C#高级特性(反射)的更多相关文章

  1. Java高级特性——反射机制(第二篇)

    在Java高级特性——反射机制(第一篇)中,写了很多反射的实例,可能对于Class的了解还是有点迷糊,那么我们试着从内存角度去分析一下. Java内存 从上图可以看出,Java将内存分为堆.栈.方法区 ...

  2. PHP高级特性-反射Reflection以及Factory工厂设计模式的结合使用[代码实例]

    PHP高级特性-反射以及工厂设计模式的结合使用 [结合 Laravel-Admin 代码实例讲解] 利用反射来实现工厂模式的生产而无需创建特定的工厂类 本文地址http://janrs.com/?p= ...

  3. Java高级特性——反射机制(第一篇)

    ——何为动态语言,何为静态语言?(学习反射知识前,需要了解动态语言和静态语言) 动态语言 >是一类在运行时可以改变其结构的语言,例如新的函数.对象.甚至是代码可以被引进,已有的函数可以被删除或者 ...

  4. Java高级特性—反射和动态代理

    1).反射 通过反射的方式可以获取class对象中的属性.方法.构造函数等,一下是实例: 2).动态代理 使用场景: 在之前的代码调用阶段,我们用action调用service的方法实现业务即可. 由 ...

  5. JAVA高级特性反射和注解

    反射: 枚举反射泛型注解.html34.3 KB 反射, 主要是指通过类加载, 动态的访问, 检测和修改类本身状态或行为的一种能力, 并能根据自身行为的状态和结果, 调整或修改应用所描述行为的状态和相 ...

  6. Java高级特性——反射机制(完结)——反射与注解

    按照我们的学习进度,在前边我们讲过什么是注解以及注解如何定义,如果忘了,可以先回顾一下https://www.cnblogs.com/hgqin/p/13462051.html. 在学习反射和注解前, ...

  7. Java高级特性——反射机制(第三篇)

    获取类运行时的结构 通过反射获取运行时类的完整结构 Field.Method.Constructor.Superclass.Interface.Annotation >实现的全部接口 >所 ...

  8. Java高级特性——反射

    感谢原文作者:peter_RD_nj 原文链接:https://www.jianshu.com/p/9be58ee20dee 注意:同一个类在JVM中只存在一份字节码对象 概述 定义 JAVA反射机制 ...

  9. 云端卫士实战录 | Java高级特性之多线程

    <实战录>导语 一转眼作为一名Java开发者已经四年多时间了,说长不长说短不短,对于java的感情还是比较深的,主要嘛毕竟它给了我饭吃.哈哈,开个玩笑.今天我想借此机会来和大家聊聊Java ...

  10. Spring框架学习[IoC容器高级特性]

    1.通过前面4篇文章对Spring IoC容器的源码分析,我们已经基本上了解了Spring IoC容器对Bean定义资源的定位.读入和解析过程,同时也清楚了当用户通过getBean方法向IoC容器获取 ...

随机推荐

  1. redis集群的三种方式

    Redis三种集群方式:主从复制,哨兵模式,Cluster集群. 主从复制 基本原理 当新建立一个从服务器时,从服务器将向主服务器发送SYNC命令,接收到SYNC命令后的主服务器会进行一次BGSAVE ...

  2. java关键字的概念与特征和标识符的概念和规则

    什么是关键字 比如说邮箱地址 abc@qq.com  123abc@qq.com 这样的只要没有人占用都是和发布的 那么这样呢 hahah@enen@itcast.cn呢 @是电子邮箱当中有特殊含义的 ...

  3. html的基础01

    1.什么是网页 2.常用的浏览器有哪些 3.web标准是什么  1.什么是网页  2.常用的浏览器 360.百度那些都是国产浏览器,内核一样,以上六个都是国际浏览器,不同厂商生产(但IE和Edge都是 ...

  4. Auto.js 特殊定位控件方法 不能在ui线程执行阻塞操作,请使用setTimeout代替

    本文所有教程及源码.软件仅为技术研究.不涉及计算机信息系统功能的删除.修改.增加.干扰,更不会影响计算机信息系统的正常运行.不得将代码用于非法用途,如侵立删! Auto.js 特殊定位控件方法 操作环 ...

  5. google nexus5x 刷机抓包逆向环境配置(二)

    本文仅供学习交流使用,如侵立删! google nexus5x 刷入永久TWEP和Magisk(面具root) 操作环境 nexus5x kaliLinux win10 准备 下载链接:https:/ ...

  6. linux-0.11分析:init文件 main.c的第二个初始化函数trap_init() 第五篇随笔

    2.第二个初始化函数,trap_init() 参考 [github这个博主的 厉害][ https://github.com/sunym1993/flash-linux0.11-talk ] kern ...

  7. 关于MySQL function创建的限制

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. MySQL 的function创建会有各种限制,经常使用的语句的限制如下: 1.CONTAINS_DYNAMIC_SQL ...

  8. (WebFlux)002、如何打印日志与链路ID

    一.背景 最近在持续改造项目,想通过日志查看用户所有的接口链路日志.在原来基于SpirngMVC的时候,那是比较好处理的,通过ThreadLocal,放入TraceId,就可以把一个TraceId传到 ...

  9. flutter系列之:flutter架构什么的,看完这篇文章就全懂了

    目录 简介 Flutter的架构图 embedder engine Flutter framework Widgets Widgets的可扩展性 Widgets的状态管理 渲染和布局 总结 简介 Fl ...

  10. React报错之Expected an assignment or function call and instead saw an expression

    正文从这开始~ 总览 当我们忘记从函数中返回值时,会产生"Expected an assignment or function call and instead saw an express ...