Trying to implement DDD using ASP.NET Boilerplate and Entity Framework
Employee
object
public class Employee : Entity<long>
{
public virtual string Name { get; protected set; }
public virtual Nationality Nationality { get; protected set; }
}
defines property Nationality
, which is value object
public class Nationality : ValueObject<Nationality>
{
public virtual string Name { get; protected set; }
}
Attempt to add database migration produces obvious error
EntityType 'Nationality' has no key defined. Define the key for this EntityType.
Took a look at 3 different approach to persist value object in database
Should i implement one of the above mentioned method manually to persist ValueObject
(if so what are some of the best practices) ? or it's already done by ASP.NET Boilerplate Framework ?