So I have the following code:
所以我有以下代码:
public Dictionary<int, Class1<Class2>> someDictionary;
public T DoThings<T, U>(int id) where T : Class1<U>, new() where U : Class2, new()
{
T something = null;
if (!someDictionary.ContainsKey(id))
{
something = new T();
someDictionary.Add(id, something);
}
return something;
}
pub