When using OwnsOne to map complex types, the sql column name is prefixed with the attribute name. Is it possible to specify the prefix name in the mapping?
This is my mapping:
e.OwnsOne(x => x.Attributes, cb =>
{
cb.OwnsOne(a => a.Supplier);
});
I would like the sql column to be prefixed with "Attr_" Instead of "Attributes_". Is this possible?
OwnsOne
builder action argument. e.g..OwnsOne(e => e.Address, cb => { cb.Property(e => e.Postcode).HasColumnName("Postcode"); });
[Column("Supplier")]
will use that for column name without prefix. The attributeColumn
exists in the namespaceSystem.ComponentModel.DataAnnotations.Schema
This method has the advantage of being local to the entity class file so other developers adding additional properties can notice the need to override column names by noting existing properties.