//实现反射
public class Workreflex
{
public bool Establish(string className, Guid guid)
{
Type type = Type.GetType("DB.UnitOfWork.WorkEstablish." + className);
MethodInfo[] methods = type.GetMethods();
MethodInfo method = type.GetMethod("Establish", new Type[] { typeof(Guid) });
object obj = Activator.CreateInstance(type);
return (bool)method.Invoke(obj, new object[] { guid });
}
}
//被反射实体
public class UserEstablish
{
private WorkServices _workServices { get; set; }
public UserEstablish(WorkServices workServices)
{
_workServices = workServices;
}
public bool Establish(Guid guid)
{
_workServices.GetEntityUpdate(guid);
return true;
}
}
***我现在反射这个方法就会报错求大神给一个解答