I've read about Owned Types and Value Conversion (as of Version 2.1). But my case is this, i've a lot of entities that have one or more properties that have static values for example:
public class Entity
{
public Gender Gender {get;set;};
}
public enum Gender
{
Male,
Female
}
This is for a web api that is going to be consumed from an external website. So, for those Complex types there is no way to get the string identifier to build a dropdown, or something like that. So i've thought on creating a single table for storing all the static types like this:
public class RefType
{
public int RefTypeId { get; set; }
public string GroupName { get; set; }
public int Key { get; set; }
public string Value { get; set; }
}
public class Entity
{
public RefType Gender {get;set;}
public RefType Type {get;set;}
}
And every entity on the domain of the app is going to have a non-restrictive FK to this table. Is this aproach ok? Or which aproach you recommend me to use?