vendredi 30 janvier 2015

How to use "static data" properly with (Fluent) NHibernate

In our database we have "static data" where ids are assigned manually by hand and they are the same through out the whole life of project. In various places, we check if objects have the same ids with these static data such as:


enter image description here


Although, the data never changes using ids inside the code is really awful and I would like to change this to more readable and maintainable structure. I am thinking about using an enum but I am not sure how should I init the enum with fluent nhibernate. Any ideas/tips on how I can achieve this ?


Aucun commentaire:

Enregistrer un commentaire