views:

163

answers:

2

I have started to develop a repository using LINQ to SQL against SQL CE in a Windows project. This works fine. However, when I went to port the code over to .NET CF for a Windows Mobile application, the IQueryable does not appear to exist.

What is the best way to make this work across Mobile and Desktop?

A: 

It's in System.Linq

Edit:

Withdrawn - I didn't see he was looking at Compact framework. The documentation doesn't say anything specific about it for compact framework (meaning it's probably not included, but that's not conclusive). I'll leave this up for now to help others avoid my mistake.

Joel Coehoorn
+3  A: 

It simply isn't there - most notably, because neither is Expression (although you can reintroduce pieces of that if you need).

Simply, you'll have to limit yourself to "regular" code for data-access (LINQ-to-SQL etc) / services (ADO.NET Data Services etc). Of course, when you have data from whatever source, you can still use IEnumerable<T>, so there are plenty of local options for data query.

Marc Gravell
Any suggestions for ORM then? Or back to writing my own data access layer?
Chad
For ORM? Does sync-services work on CF? I honestly don't know...
Marc Gravell