Wednesday, June 27, 2018

NHibernate Immutable Types

To prevent that changes to your objects end up accidently into your database, NHibernate supports type immutability.

This is something you can set at the ClassMap level(if you are using the mapping by code):

With Fluent Nhibernate, you have to use the ReadOnly property:

Remark: Using this property makes sure that the objects that you retrieve are read-only, so you cannot UPDATE them. However, it does NOT prevent the creation of new records or even the deletion of existing records in the database.

1 comment:

ezhil arasi said...

All the latest updates from the PythonAutomationminds team. Python Automationminds lets you program in Python,

in your browser. No need to install any software, just start coding straight away. There's a fully-functional web-based

console and a programmer's text-editor
Phyton training in Chennai