我在F#中有以下类继承了Microsoft.AspNet.Identity.IIdentityValidator接口:
type MyValidation() =
inherit IIdentityValidator<string> with
member x.ValidateAsync (value:string) : Task<IdentityResult> =
.....
我收到此错误:
This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'.
为什么以及如何解决?
答案 0 :(得分:5)
关键字inherit
仅适用于派生类。您需要使用interface
:
type MyValidation() =
interface IIdentityValidator<string> with
member x.ValidateAsync (value:string) : Task<IdentityResult> =
...