×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    14

    Question Is Entity Framework 4.1 and Code First available

    I'm having a little trouble trying to figure out if Entity Framework 4.1 (with code first approach) is available to us on Windows Phone 7.1. Any ideas?

    I'm getting the impression its not as it needs SQL version 4.0 and Windows Phone ships with SQL Compact 3.5, but anybody have any luck getting it to work?

    Any advice on how to implement a ORM layer on Windows Phone would be greatly appreciated. I am currently using LINQ to SQL using "System.Data.Linq" and "System.Data.Linq.Mapping" but it seems to require a fair amount of plumbing code in comparison to using EF 4.1 and code first.

    Any ideas?

    /Damien

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2012
    Location
    Bilbao
    Posts
    53

    Re: Is Entity Framework 4.1 and Code First available

    Hi!

    In Windows Phone you only have access to Linq to SQL, no any version of EF can be used. You can generate a dbml file in a windows phone project simply adding a new item (for example a text file) and in the name textbox set it to anyname.dbml it adds a dbml file that generate all code for you. After create the model for your database you need to edit the generated code and delete the constructors that use IDbConnection because its not supported on Windows Phone.

    This way you can generate your ORM layer very visually and writting zero code.

    Hope this helps you.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    925

    Re: Is Entity Framework 4.1 and Code First available

    Plus to what Josue said, take a look at this article for a step by step on local storage.

    http://binarywasteland.com/2012/03/w...abase-storage/

  4. #4
    Registered User
    Join Date
    Mar 2012
    Posts
    14

    Re: Is Entity Framework 4.1 and Code First available

    Thanks guys for the help and pointers. I like the Entity Framework, hopefully we'll see it in a future release.

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    14

    Re: Is Entity Framework 4.1 and Code First available

    Quote Originally Posted by joaocardoso View Post
    Plus to what Josue said, take a look at this article for a step by step on local storage.

    http://binarywasteland.com/2012/03/w...abase-storage/
    Thanks João, nice consise writeup there.

Similar Threads

  1. Replies: 0
    Last Post: 2003-07-23, 14:41
  2. Entity reference syntax error
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-14, 20:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×