intesoft wrote:
I developed this NHibernate.Helper project some time ago for use with ASP.NET. It may be something someone finds useful:
http://blogs.intesoft.net/simon/articles/16.aspxThe POCO classes I use have static methods for such things as GetById, GetList and so on which uses these helper clases but these could easily go in a separate layer. I like the way the code reads when they are used, eg:
Customer customer = Customer.GetById( 123 );
IList customers = Customer.GetListByRegion( "North" );
Hi Simon.
I have two questions about your solution:
1) Why have you used CLSCompliant(false)? Sorry, I didn't understand :(
2) How do you do when you have the following:
Code:
Class1 obj1 = new Class1();
obj1.Save();
Class2 obj2 = new Class2();
obj2.Save();
If these objects need to be saved using the same transaction, how do you perform this operation? As I saw, your Save() method calls transaction.Commit(), so I think you can't do it using that (Db.Save...) approach, right?
Thanks man!