My Entity has no primary key for some reasons:
public partial class VehicleLocation
{
public virtual string UserCode { get; set; }
public virtual string DateTime { get; set; }
public virtual string Device { get; set; }
public virtual string Gps { get; set; }
public virtual string GpsDateTime { get; set; }
public virtual double Speed { get; set; }
}
The mapping:
class VehicleLoactionMap : ClassMap<VehicleLocation>
{
public VehicleLoactionMap()
{
Table("VEHICLE_LOCATION");
LazyLoad();
Map(x => x.UserCode).Column("USER_CODE");
Map(x => x.DateTime).Column("DATE_TIME");
Map(x => x.Device).Column("DEVICE");
Map(x => x.Gps).Column("GPS");
Map(x => x.GpsDateTime).Column("GPS_DATE_TIME");
Map(x => x.Speed).Column("SPEED");
}
}
I got this error:
The entity 'VehicleLocation' doesn't have an Id mapped...
How can I map my entity without using a primary key?