Linq Like SqlMethods
Posted on: Thu Nov 05 15:34:43 -0800 2009. Updated on: Thu Nov 05 15:36:26 -0800 2009.
Category: DotNet
Category: DotNet
Sql methods are a neat tool inside of linq. They allow you to do typical functions we are used to from sql but nicely built into linq. They are found under: using System.Data.Linq.SqlClient;
// Example where dc is DataContext
var query = from u in dc.Users
where SqlMethods.Like(u.UserName, "%johnny%")
select u;