When adding elements to a newly created DbSet, are IDs always generated from 1 to (number of elements)... or do I have to add some code to make sure this happens...
The real problem is that I want to have
public DbSet<Student> Students { get; set; }
public DbSet<StudentPointer> top100allTime { get; set; }
so I have
public class StudentPointer
{
public int StudentPointerID { get; set; }
public int StudentID { get; set; }
public int Votes { get; set; }
}
and
public class Student
{
public int StudentPointerID { get; set; }
public int StudentID { get; set; }
public String name { get; set; }
}
so what happens here is that every time a user votes on a student I get the StudentPointer on top100allTime.. update its "Vote" variable... then assuming that "top100allTime" students are always in order of votes, I get the neighbor by its ID which is one number up, compare its votes, switch places in the top list if I have to.
This only works if IDs on dbSet always are generated in order from 1 to (number of elements)
that's why I am asking
or is there a more efficient way to make a top100List?