0

I'm trying to use Like-queries as shown in Dommel documetation:

using (var con = new SqlConnection())
{
   var products = con.Select<Product>(p => p.Name == "Awesome bike");
   var products = con.Select<Product>(p => p.Created < new DateTime(2014, 12, 31) && p.InStock > 5);
}

but when i try to execute this piece of code:

using (DbContext ctx = new DbContext())
{
    IEnumerable<User> users = ctx.Connection.Select<User>(u => u.UserName.StartsWith("op", StringComparison.InvariantCultureIgnoreCase));
    usersBindingSource.DataSource = users.ToList();
}

I'm getting this exeption:

An expression of non-boolean type specified in a context where condition is expected, near '('

I'm using Dommel.1.11.0

Thanks.

Giancarlo Melis
  • 697
  • 4
  • 17

1 Answers1

1

The author of Dommel (Henk Mollema) says that StartsWith is only available from version 2.0, currently in beta.

Giancarlo Melis
  • 697
  • 4
  • 17