Ability to map any serializable object to XML, JSON or binary columns
For example a database table could have a [Settings] column of type xml. And a mapped entity type could have a property [Settings] of some serializable type. Then you will be able to read and write data into and from this [Settings] column with EF. Like this:
var user = db.Users.First(x => x.ID == 1);
if (user.Settings == null)
user = new Settings();
user.Settings.ProductsPerPage = 20;
Value conversions included in EF Core 2.1 can enable this. There won’t be a convention to enable serialization by default but the user can enable this explicitly for a property in configuration.
Please create issues in our issue tracker if you find any problems.
Eniola Benjamin commented
Hibernate has a similar feature where you can have HashMaps of values and have them stored in one column rather than as Entities/Tables.
The same thing will apply for Scalar complex objects that we want to serialize as XML rather than back with a column mapped to each property of the Complex object.
Oh, this would be lovely!
I need this too!