反射動態調用子類方法
阿新 • • 發佈:2017-05-06
mes quotes obj aps tty 方法 snapshot handler hot
//Type type = Type.GetType("Domain.Entitiy." + item.Name);
//object handler = Activator.CreateInstance(type);
//Func<string, QueryStoresOutput> hook = o => ((dynamic)handler).QueryStore((dynamic)o);
//var res = hook(cityCode);
Type type = Type.GetType("Domain.Entitiy." + item.Name);
object handler = Activator.CreateInstance(type);
Func<BusinessSystemSubmitInputModel, QuoteSnapshot> hook =
o => ((dynamic)handler).GetQuote((dynamic)o);
var res = hook(model);
Action<object> hook = message => ((dynamic)handler).HandleMessage((dynamic)message);
反射動態調用子類方法