I have an object that contains an attribute with the type of another object, which I want to treat as Complex Type.
public class Location : IModule
{
public string Id { get; set; }
public Coordinate Coordinate { get; set; }
}
[ComplexType]
public class Coordinate
{
public string Latitude { get; set; }
public string Longitude { get; set; }
}
While adding a migration, I ran into the problem that a primary key is required (exactly what I want to prevent).
The entity type Coordinate
requires a primary key to be defined.
EDIT
For performance reasons I want the properties being stored as Coordinate_Latitude
and Coordinate_Longitute
instead of having a reference to another table.