Open xperiandri opened 2 years ago
Hi @xperiandri
It looks like the issue is from when trying to set the UserId
type as your key type
To allow using it you need to implement IEquatable
This may be what you need
[<Struct; CustomEquality; CustomComparison>]
type UserId =
| UserId of Guid
interface IComparable with
member x.CompareTo y =
match y with
| :? UserId as y ->
match x, y with
| UserId x', UserId y' -> x'.CompareTo y'
| _ -> -1
interface IEquatable<UserId> with
member x.Equals(y) =
match x, y with
| UserId x', UserId y' -> x' = y'
Let me know if it works for you or if you had to make any other changes to get it working
Describe the bug Having such IdentityUser definition
when I make
UserId
asand [<Struct>] UserId = UserId of Guid
I get the errorThe binary operator Equal is not defined for the types 'UserId' and 'UserId'
Expected behavior No error
Desktop (please complete the following information):
Smartphone (please complete the following information):