protected abstract Task <object> DoRequest(CobRequestContext context, Type realType, object state);
protected internal Task <object> MatchRealType(CobRequestContext context, Func <Type, Task <object> > action) { var realReturnType = TaskHelper.GetUnderlyingType(context.ReturnType, out bool isTask);//去掉task/void等泛型 return(action(realReturnType)); }
public Task <object> DoRequest(CobRequestContext context, object state) { return(MatchRealType(context, realType => DoRequest(context, realType, state))); }