C#

You are currently browsing articles tagged C#.

 
    protected void cast_ifnotnull<H, T>(H from_here, ref T to_value) where T : System.IConvertible 
     {
         if (from_here != null)
             to_value = (T)Convert.ChangeType(from_here, typeof(T), CultureInfo.InvariantCulture);
         else to_value = default(T);
     }
    protected T cast_ifnotnull<H, T>(H from_here) where T : System.IConvertible
    {
        if (from_here != null)
            return (T)Convert.ChangeType(from_here, typeof(T), CultureInfo.InvariantCulture);
        else return default(T);
    }

Non so. Non mi convince ancora.

Technorati Tags: , , ,

First of all read the not-so-QuickStart page from Hibernate.org. Update: another good source of info is Baccus.
After spending an half-a-day to make it work, I collected here some issues and fixes.
As you can read in the comments in the same page, the QuickStart tutorial doesn’t work out of the box. I think there are different issues: the main one is that probably it’s a bit outdated vs the current NHibernate version. But the comments in that page are indeed very useful. If you have problem running the Quickstart, have a look there. Credit for many solutions goes to the guys that posted their fixes on that page.

Read the rest of this entry »

Technorati Tags: , , , , ,