Since it is boring having to specify every time the Schema a table belongs to, it would be nice having a conventional strategy to automatically wire up this information. With NHibernate mapping by code functionality this is simple. The strategy I propose is having the last part of the entity namespace being equal with the schema. So for example we have an entity Product in the schema named Production we define the entity as:
Then by using a ConventionModelMapper we can write:
public class MyModelMapper:ConventionModelMapper
this.BeforeMapClass += (modelInspector, type, customizer) =>
And we achieve to write less line again :)
a@href@title, b, strike, strong
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.