【发布时间】:2021-12-30 05:31:39
【问题描述】:
我想为一个函数使用多个泛型,但这不起作用
protected async Task<Tlist,T> Send<Tlist,T>(string url,HttpMethod method,DateTimeSyncedAt ) where Tlist,T:class
{
}
【问题讨论】:
-
Task<T>只有一个通用参数。你希望做什么? -
这有效:
protected async Task<R> Send<T, R>(T source) where T : class where R : class。这有帮助吗? -
是的,谢谢
-
@regestea23 - 什么“有效”?
标签: c#