Sunday, 13 March 2022

asp.net core entity issues

 > in my entity i have two ids so the entity unable find based on id
so i have commented or removed one id which is autogenerated . 

code below:

https://qawithexperts.com/article/c-sharp/using-entity-framework-join-ef-join-to-join-two-or-more-tabl/192


/ /entity.HasKey(e => new { e.AddressId, e.LinkId });

                entity.HasKey(e => new {  e.LinkId });

                entity.ToTable("Address", "Web");


                //entity.Property(e => e.AddressId)

                //    .ValueGeneratedOnAdd()

                //    .HasColumnName("AddressID");


                entity.Property(e => e.LinkId).HasColumnName("LinkID");

No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...