Today I received a log of an error in a windows service that runs some scheduled actions, the error was TooManyRowsAffectedException and it is thrown by nhibernate when a session is flushed. The exact message said Unexpected row count: 2; expected: 1 , after a little moment of confusion I immediately realize that the problem [...]
Continue reading about NHibernate and TooManyRowsAffectedException
Suppose you need to paginate and letting the user choose the sort field in entity framework, lets see how you can accomplish this. In EntityFramework you can query with E-SQL both building a query in string format, but also using standard method syntax, here is an example (based on NorthWind) var query = context.Customers .OrderBy(“it.ContactTitle”); [...]
Continue reading about Entity Framework, dynamic sorting and pagination
Today I decided to install the beta of the new version of Resharper. I must admit that I cannot work without reshaper now I’m so used to it that if I work with computers with no R# I spent some second Hitting shortcut and wondering why nothing happens . Here is my impression Installer is [...]

I have a domain model composed by Clients, each client has a series of associated Typology objects and each Typology object has a certain number of associated Target. Now I need to bind this model to a series of three combo in WPF, but I have this little problem The model is not directly accessible, [...]
Continue reading about Adapting a model to make binding simpler.
Today I had a strange problem, I needed to host a MSMQ service in IIS7, I followed the instruction on this post. Everything worked ok, I pumped some messages on the queue and the service received them with no problem….at least initially. After a bit of time of inactivity, the server stopped to read message [...]
Continue reading about Hosting a WCF service based on MSMQ in IIS7