When I create domains, I usually create a parameterized constructor for it:
namespace Models
{
public class Unity
{
public string Abreviation { get; set; }
public string Description { get; set; }
public Unity (string abreviation, string description)
{
Abreviation = abreviation;
Description = description;
}
public Unity ( ) { }
}
}
In this way the user of the class has the option of passing the value of the properties at the same time as the instantiation of the object. Or pass them later through the setters.
Is this valid in EF?