Unfortunately this kind of property mapping is still not supported by Entity Framework. You probably have to fall back to tricks like this:
public class MyEntity
{
//...
[NotMapped]
public MyComplexType MyComplexType { get; set; }
public string MySerializedComplexType
{
get { return Serialize(MyComplexType); }
set { MyComplexType = Deserialize(value); }
}
//...
}
(Instead of the [NotMapped]
attribute you can use modelBuilder.Entity<MyEntity>().Ignore(e => e.MyComplexType)
if you prefer Fluent API.)