Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:55:50+00:00 2026-06-12T23:55:50+00:00

i use Entity Framework 5.0 by Model First. In 4.x there is a bug:

  • 0

i use Entity Framework 5.0 by “Model First”. In 4.x there is a bug: the designer can’t handle primary column guid with identy and defaultValue: “newid()” (source: http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/)

Is it still not possible to use this in EF5? What is the problem to transform c# guid to sql “uniqueid” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:55:51+00:00Added an answer on June 12, 2026 at 11:55 pm

    This worked for me doing database-first, but may help you after you’ve created your database –

    You can update the table and set the default value as newid() using Server Management Studio (not through EF).

    Then in the EF model, update the StoreGeneratedPattern from none to Identity.

    2013 edit:
    For completeness, in EF 5.0 Codefirst, you can specify the following data annotation:

    [Key]
    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
    public Guid TableIdColumn { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's sample model classes, which being use with Entity Framework Code First: public class
I'm trying to use Entity Framework 5 Code First. I've created model classes and
I use Entity Framework code-first. DataBaseName - I want to create a database in
When using the Entity Framework there are basically two ways to create your model.
I have a small MVC 3 app using Entity Framework Code First and use
I currently use a generic repository pattern with Entity Framework code first: public interface
In short: can I use a literal SQL subquery somehow in the entity model
I'm trying to use Entity Framework for my model/data access, and running into speed
I'm building my application with Entity Framework (model first principle). I'm also using MS
I'm working with Entity Framework (Model First approach) against a PostgreSQL 9.1 database. You

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.