how to check if object already exists in a list

前端 未结 9 1821
梦谈多话
梦谈多话 2020-11-28 05:41

I have a list

  List myList

and I am adding items to a list and I want to check if that object is already in the list.

9条回答
  •  广开言路
    2020-11-28 05:49

    If you use EF core add

     .UseSerialColumn();
    

    Example

    modelBuilder.Entity(entity =>
            {
                entity.ToTable("jobs");
    
                entity.Property(e => e.Id)
                    .HasColumnName("id")
                    .UseSerialColumn();
    });
    

提交回复
热议问题