2
votes

I have the following class in F# that inherits Microsoft.AspNet.Identity.IIdentityValidator interface:

type MyValidation() =
    inherit IIdentityValidator<string> with
        member x.ValidateAsync (value:string) : Task<IdentityResult> =
        .....

I am getting this error:

 This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'.

Why and how do I fix it?

1
I point out that Microsoft.AspNet.Identity.IIdentityValidator does not belong to C#. - phoog
It belongs to ASP.NET? - Marta
That would be a better way of describing it. - phoog
edited question to fix that - knocte

1 Answers

5
votes

The keyword inherit is just for derived classes. You need to use interface:

type MyValidation() =
    interface IIdentityValidator<string> with
        member x.ValidateAsync (value:string) : Task<IdentityResult> =
            ...