Blog Stats
  • Posts - 27
  • Articles - 0
  • Comments - 3
  • Trackbacks - 1204

 

September 2009 Entries

NHibernate with LINQ: Error with String Comparisons in VB.NET

If you’re in VB.NET using LINQ to NHibernate and you get this error on a simple query: System.ArgumentException : Expression of type 'System.Int32' cannot be used for return type 'System.Boolean' Then I’ve got an explanation and a fix for you. Here’s a query that will produce this error: Dim result = nhQueryProvider.Where(Function(code) code.Name = "OPEN") If you load up the NHibernate.Linq code and debug through it, you find that the Expression being evaulated is not what you’d guess.  You’d think it would be something simple: code.Name = "OPEN" But...

Domain Driven Design (DDD): An Exercise in Value Objects

I’m reading the Eric Evans book on DDD and wanted to catalogue some notes as I’m going through it to help me clarify and solidify what I’m picking up from the book. DDD, as I understand it, encourages programmers to build a rich domain model of a system that is separate from the user interface and infrastructure (database, etc.) of the system.  The domain model is made up of three types of components: Entities, Value Objects, and Services. The distinction between Entities and Value Objects is a bit of a subtlety.  Here are some characteristics of something the...

 

 

Copyright © Jason Pettys