HasConversion not working with EF Core 8 when converting an Enum

HasConversion not working with EF Core 8 when converting an Enum

Hi,

We're using HasConversion<string> to convert an Enum to string and vice versa but it's throwing an Exception.
We've also tried the following syntax :

.HasConversion(
    v => v.ToString(),
    v => (EUserType)Enum.Parse(typeof(EUserType), v));

But we're getting the same exception.

The exception is : Invalid cast from 'System.String' to 'EUserType'.

It's working when using .HasConversion<int> but not .HasConversion<string> and we need the value to be a string.