在 WCF RIA Services 中有一个 AuthenticationBase
类。该类定义如下:
// assume using System.ServiceModel.DomainServices.Server.ApplicationServices
public abstract class AuthenticationBase<T>
: DomainService, IAuthentication<T>
where T : IUser, new()
在这段代码中,
new()
是什么意思?
T
是通用类型“参数”,但实际使用的类型(例如object
,int
)是类型参数。 - Jon Skeet