首页 > 代码库 > C# 返回泛型

C# 返回泛型

public static T GetObj(Employee model) { T result = default(T); if (model is T) { result = (T)(object)model; //或 (T)((object)model); } return result; }

C# 返回泛型