I been reading nhibernate for beginners 3.0 and been reading about common mistakes(a few of them I been making)
I am wondering what are some strategies for making one or more records readonly. Right now I get all the rows back and loop through them making them readonly through session.Readonly().
I like in the book that they do with fluent
class EntityMap : ClassMap<Entity>
{
public EntityMap()
{
SchemaAction.None();
ReadOnly();
// Mappings
}
}
What I am not sure is what happens if I need these records to not be Readonly? To me this means I have to make this exact same mapping minus those 2 lines of code.
So I would like to do this and have ReadonlyEntityMap and EntityMap but I rather not have to duplicate all the settings twice.
Anyone have ideas on how do to this? Or better ideas for readonly?