I use CodeConfig as opposed to XML files for Spring.NET, using Fluent NHibernate to read / write to the database.
But for transaction management, I still want to use the Spring [Transaction] attribute for my maintenance methods. In XML, I would do
<tx:attribute-driven/>
I can get around this by processing a transaction like this
public WorkItem SaveWorkItem(WorkItem workItem) { using (ITransaction tx = CurrentSession.BeginTransaction()) { CurrentSession.SaveOrUpdate(workItem); tx.Commit(); } return workItem; }
But is there only a CodeConfig way to use this attribute, for example:
[Transaction] public WorkItem SaveWorkItem(WorkItem workItem) { CurrentSession.SaveOrUpdate(workItem); return workItem; }
thanks
source share