Marta
Marta

Reputation: 1162

F# inherit interface

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?

Upvotes: 2

Views: 435

Answers (1)

knocte
knocte

Reputation: 17929

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> =
            ...

Upvotes: 5

Related Questions