Category: C# Blogs

NHibernate 3.2, What’s New?

NHibernate Benjamin Perkins

The newest release is as BETA 1 when writing this blog an it contains some new and nice features. One of my favorite is that as a programmer we no longer need to configure a proxy. It was always a little confusing knowing which one to choose, I.e. looking in the Required_For_LazyLoading directory and deciding […]

Read More →

Using LIKE with LINQ to NHibernate in C#

NHibernate Benjamin Perkins

The equivalent to LIKE via the LINQ to NHibernate provider is Contains. An example of a LINQ to NHibernate that will return a result set matching a search like parameter is below. IQueryable<Classname> linqLIKE =         (from m in session.Query<Classname>()          where m.Code.Contains(“%dex%”)          orderby m.CreateDate          select m); IList<Classname> ListLIKE = linqLIKE.ToList(); The above […]

Read More →

How to add double quotes to a string

I needed to save an XML formatted file as a string which required double quotes around the attributes. The below code shows how to add double quotes to a string. string data      = “<customer name=\”Ben Perkins\” class=\”Customer\”>        <property name=\”Id\” /><property name=\”Address\” />        <property name=\”Occupation\” />        <property name=\”Remark\” /></ customer >”; Notice […]

Read More →