-
I've recently discovered the This options tells nhibernate to escape all table and column names. For example a column named Example on how you could turn on the Quote Table and Columns options. IPersistenceConfigurer configuration = MsSqlConfiguration.MsSql2012
.ConnectionString(connectionString)
.AdoNetBatchSize(1000);
var fluentConfig = Fluently.Configure()
.Database(configuration)
.ExposeConfiguration(SchemaMetadataUpdater.QuoteTableAndColumns)
.Mappings(m => m.FluentMappings.Add(fluentMappingTypes)); This setting seems to work fine until you try to map a // Domain object
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
public IList<KeyValuePair> Parameters { get; set; }
}
// Mapping class
public class FooMap : ClassMap<Foo>
{
public FooMap()
{
Id(x => x.Id).GeneratedBy.Assigned();
Map(x => x.Name);
HasMany(x => x.Parameters)
.Table("FooParameter")
.KeyColumn("Foo_id")
.Component(c =>
{
// Without the Column name override trying to save an instance of Foo will fail
c.Map(x => x.Key).ColumnName("[Key]"));
c.Map(x => x.Value);
})
.Cascade.AllDeleteOrphan();
}
} Am I wrong to assume that the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think this was fixed in around NH 5 |
Beta Was this translation helpful? Give feedback.
I think this was fixed in around NH 5