I have a class User as below with an enum field Type. How can I store string value of enum in SQL instead of numeric value?
public class Student
{
public int Id { get; set; }
public string FullName { get; set; }
public UserTypeEnum Type { get; set; }
public List<int> CourseIds { get; set; }
}
public enum UserTypeEnum
{
Bachelor = 10,
Master = 11,
PhD = 12
}
I have tried to do it using EF Core but it doesn't work.