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

remove duplicates in an sorted array

  using System; public class HelloWorld {          public static void Main(string[] args)     {         int[] ar={2,2,3,3,4,6,6};          C...