Zoran Knezevic - 237 - Aug 29, 2014

Hi,
I’m trying to use OrmLite to replace some places where I am using Entity Framework.  I would like to use this example which I found on the OrmLite page.

Person personByAge = db.Single<Person>(x => x.Age == 42);

But I get this compile time error: “Cannot convert lambda expression to type ‘ServiceStack.OrmLite.SqlExpression<Person>’ because it is not a delegate type”  

What am I doing wrong?

Thanks,
Zoran

Can’t tell from here, it works perfectly fine in: https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/tests/ServiceStack.OrmLite.Tests/ApiSqlServerTests.cs#L47

Do you have any dll reference issues?

Zoran Knezevic:

I have the same using statements and I reference all SS dlls.  What is more odd is that the db.Update<Person>(person, p => p.ID == 50); has the same signature and there I don’t get a compile time error.

I am on version 4.0.17.0.  Is it possible that this issue is tied to the SS version?

I doubt it’s a v4.0.17 issue, those Api tests existed long before v4.0.17 was released.