Sometimes differences between C# and VB could be subtle, for example consider these very simple two snippets of code, what they will print?    Sub Main()      Console.WriteLine(“Result is “ + Sum(Integer.MaxValue, 1))   End Sub    Public Function Sum(ByVal a As Integer, ByVal b As Integer)      Return a + b   End Function   static void Main(string[] args) {      Console.WriteLine(“Result is “ + Sum(Int32.MaxValue, 1));   }    public static Int32 Sum(Int32 a, Int32 b) {      return a + b;   } The first snipped written in VB throws a System.OverflowException, because the result of the operation cannot be stored into an integer value. The behavior of C# can be more surprising because [...]

Continue reading about Difference between C# and VB, simple add

Now that the Entity object works as expected the only issue remaining is the integration with NHibernate. First Step is creating mapping file to store the object in the database. Database structure is very simple, just a table for the Entity class plus another table for localized resources. Against this database schema we can map [...]

Continue reading about Localizable Entities With Nhibernate Part 3

After the creation of Registry pattern I need to create a localization scheme that will satisfy the remaining points of the list; first of all I write some tests following the best practices of Test Driven Development. The class under test will be called Entity, and has an integer property and two string properties that [...]

Continue reading about Localizable entities with Nhibernate part 2

In a recent project I face the need to localize some entity with nhibernate. First of all I found this interesting post of Ayende that show an interesting solution, but it does not fits well in my project. I need a localization scheme with these features. Orthogonal to the user, and completely transparent The user [...]

Continue reading about Localizable entities with Nhibernate Part 1

Castle framework is really interesting, but do not forget to checkout current trunk in subversion repository, since it is full of new and exciting features. In a little demo that I’m doing to made a screencast for dotnetmarche community, I show how to structure a simple web page to follow Design For Testability principles, and [...]

Continue reading about Windsor Container, Resolve(IDictionary)