Entity Framework Feature Suggestions

Support GUID as Entity Key

558 votes
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    lancefisherlancefisher shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    under review

    12 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...
      • JustinJustin commented  ·   ·  Flag as inappropriate

        mabster, I don't agree that EF should ensure that we don't create a clustered index. An orm should never didicate database design. Plus clustered index performance is just fine as long as you use NEWSEQUENTIALID(). That's the whole point of that function.

        GUIDs sometimes have to be a primary key. A perfect example is a WPF client app with offline access and peer-to-peer sync which we are building now.

      • KramKram commented  ·   ·  Flag as inappropriate

        Another glitch which, until fixed, makes EF unusable for us. We will consider putting EF into production apps when we no longer have to continually hack the edmx file, like manually re-adding the StoreGeneratedPattern="Identity" for GUID key fields every time the EDM is updated from the database.

      • mabstermabster commented  ·   ·  Flag as inappropriate

        GUIDs as primary keys are fine provided it's a non-clustered index. Baked in support for GUID keys should ensure that they don't create a clustered index when creating the table.

      • Mohammed HasanMohammed Hasan commented  ·   ·  Flag as inappropriate

        GUID not being supported 100% in the Designer is a major bug/flaw in Entity Framework 4.0 considering Microsoft itself uses GUID's as primary keys in as rudimentory framework as the SqlMembershipProvider in asp.net. Using GUID's as primary keys is a generally accepted database methodology. What were you guys thinking or not thinking? Instead of including this in the next version of the framework how about a service release to fix this problem. Manually editing the SSDL section everytime we work on a existing database model with Guid's is getting to be a major pain.

      • mikemike commented  ·   ·  Flag as inappropriate

        Yes! BUT please make sure they are sequential by date/time when generated!

      • Matthieu MEZILMatthieu MEZIL commented  ·   ·  Flag as inappropriate

        It's the same with Computed columns
        And it's a big problem, particularly with this f... designer which lose all SSDL modification when I update my model from DB.

      Knowledge Base and Helpdesk