Question

I have been tasked with porting our .NET Desktop application to a mobile device. Our desktop application uses LINQ to SQL to interact with the database. However, LINQ to SQL is not available on mobile devices. We develop for Windows Mobile 5 and 6.

I am debating between suggesting a different ORM that supports both desktop and mobile out of the box (http://www.entityspaces.net/portal/ seems the best to me). However, since our databases are relatively small (one of them is relatively simple at 10 tables; the other is 27 tables but the associations are more complex), I am leaning more towards just re-coding the domain objects and data access functions myself.

Has anyone else been in this situation? What choice did you make?

Was it helpful?

Solution

My team is using T4 to generate basic CRUD operations based on the structure of the database and the conventions we use to map our POCO classes and properties to SQL Compact tables and columns. It is a bit of work, but is working out OK.

OTHER TIPS

I can personally recommend LLBLGen. They have CF Framework support for v1.0 & 2.0. It's very quick to map tables and the resulting entities can be used in both mobile and desktop. It's also not expensive, and has a long track record. Based on your requirements, that would be the quickest way there. Doing it in POCOs (Plain Old CLR Objects) and using Linq to Objects would be doable, but would take much longer.

Here are two more options for you:

http://www.llblgen.com/defaultgeneric.aspx

http://www.devexpress.com/Products/NET/ORM/info.xml

Personally, I've never used LINQ to Sql on a the Compact Framework, the only thing I've done that's close was use Linq to Sql against SqlCe on the desktop.

Now depending on how bug your data layer is, it may be worth seeing if you can use any of those ORM's and see how much of your existing code is reusable, or it may very well be worth to just rewrite it (again, depending on the size of the project)

you can't use linq to sql directly with SqlServerCE. with CF you only have the linq to Xml, Linq to DataSet and Linq to objects flavours available. I'm working on a mobile app and because I'm consuming data with a SqlCeResultSet object, and because this object implements IEnumerable you can use Linq with it.

maybe this can help you out

http://www.pluralsight.com/community/blogs/jimw/archive/2008/02/27/50325.aspx

You might want to check out this open source framework:
Kea - Linq for Sql Compact & Compact Framework?

http://kea.codeplex.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top