Given this code:
public class Car
{
public virtual int CarId { get; set; }
public virtual string TypeName { get; set; }
public ConvertableNullab
The only solution is using something like this:
public class Car
{
public virtual int CarId { get; set; }
public virtual string TypeName { get; set; }
// This must be accessible to the mapping
public double? PriceData { get; set; }
public ConvertableNullable Price
{
get { // Return data from PriceData }
set { // Set data to PriceData }
}
}
Your mapping will be:
modelBuilder.Entity().HasKey(x=>x.CarId);
modelBuilder.Entity().Property(x => x.TypeName);
modelBuilder.Entity().Property(x => x.PriceData).HasColumnName("Price");
modelBuilder.Entity().Ignore(x => x.Price);
The problem is that EF globally doesn't have support for custom scalar types.