Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "Is Identity" setting when adding a new entity property (version 4.2.44) #63

Closed
Olivercomputing opened this issue May 24, 2023 · 9 comments
Labels
bug Something isn't working released Issue is resolved in a current release
Milestone

Comments

@Olivercomputing
Copy link

When adding a new entity, then a new property, there is no "Is Identity" setting available for that property. The type is Int64, and Indexed and Indexed Unique are set, but "Is Identity" doesn't appear.

@gilyadid
Copy link

gilyadid commented Jun 4, 2023

I also see the same problem, for now my workaround is to create a code-1st entity and drag it to designer which make the "is Identity" along with key Icon show, then I can copy-paste that entity inside the designer to create more entities.

@GGP305
Copy link

GGP305 commented Jun 21, 2023

+1 I'm also geting this behaviour. For the moment i had to reverto the previous version that functions correctly

@msawczyn msawczyn added the investigating Looking into this label Jun 22, 2023
@msawczyn
Copy link
Owner

I'm not able to reproduce that. When adding a new property, after changing the type to Int64,, I get
image

After changing the IsIdentity value to true and generating the code, in OnModelCreating I see

         modelBuilder.Entity<global::TestData.Entity2>()
                     .ToTable("Entity2")
                     .HasKey(t => new { t.Id, t.Property1 });
         modelBuilder.Entity<global::TestData.Entity2>()
                     .Property(t => t.Id)
                     .ValueGeneratedOnAdd()
                     .IsRequired();
         modelBuilder.Entity<global::TestData.Entity2>()
                     .Property(t => t.Property1)
                     .ValueGeneratedOnAdd()
                     .IsRequired();

and the property is declared as

      /// <summary>
      /// Identity, Indexed, Required
      /// </summary>
      [Key]
      [Required]
      public long Property1 { get; set; }

Could you upload an .efmodel file that exhibits the problem?

Thanks.

@msawczyn msawczyn added the need info Need more information to track this down label Jun 25, 2023
@gilyadid
Copy link

Please try the same with "Guid" type as primary key - if you still won't be able to reproduce I'll send you an .efmodel file.

@msawczyn
Copy link
Owner

I found (and corrected) an issue where the default identity properties weren't being created when a new entity is dragged on to the design surface, but still can't repro the exact issue you've posted. It's possible that something else fixed the problem earlier and it hasn't made it out yet.

I'll be posting a build of v4.2.5 to GitHub here shortly. If you would be kind enough to give that a go and see if it resolves your problem, I'd be most appreciative. It won't go out to the Marketplace yet, but can be installed manually by downloading and "executing" the vsix.

@Relki
Copy link

Relki commented Jul 20, 2023

I'm having the same problem. Revisited a dataset I haven't touched in a few months, and went to add a new entity via dragging from toolbox. It didn't automatically create the Id column like it use to with the default Int64 type and Primary key. Adding the Id column manually, didn't have the property available "Is Identity" for me to set. I compared to an existing entity in the designer, and walked down the two Id columns to make them pretty much identically, but nothing triggered the Is Identity column to appear so I could set it.

I can however, copy an existing entity in the designer, edit it and get that column back.

@msawczyn msawczyn added bug Something isn't working and removed investigating Looking into this need info Need more information to track this down labels Jul 20, 2023
@msawczyn
Copy link
Owner

I believe I have the problem diagnosed. My thanks to all for your patience and my apologies for the problem existing. Should be resolved soon.

@Relki
Copy link

Relki commented Jul 20, 2023 via email

@msawczyn msawczyn added this to the 4.2.5 milestone Jul 31, 2023
@msawczyn msawczyn added the pending release Issue is resolved in the current codebase, will be published with the next release label Jul 31, 2023
@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Jul 31, 2023
@Olivercomputing
Copy link
Author

Thank you very much for fixing this and other reported bugs. I use EF Designer practically every day, so it's an important tool for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

5 participants