Tags: C#

TextChanged vs. SelectionChange events in WPF

Benjamin Perkins C#

I made the mistake of using the SelectionChange event on a textbox while implementing some filtering on a DataGrid. What happened, when using SelectionChanged, was that each time the textbox received focus I was executing the filter. Even initially when there was nothing to filter. My logic was checking if the contents of the textbox […]

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 →