ASP.net MVC with Entity Framework Database Entry Registration

I struggled to find a resource that could help me solve my problem, and it seems like a rather difficult problem to wrap my head around.

Let's say I have a table in the database (100 records) with a whole field of the sequence (which is incremental). Now I have the functionality to reorder the list in which the user can drag an element from the bottom of the word to the middle (for example, a sequence of 100 → 50).

At the moment, I have determined that the record sequence will be 50, and each record will be updated with a subsequent sequence of 1+. (e.g. 50 becomes 51, 51 equals 52), so on ...

This is ineffective for me, since it has to update 50 records in order to change the sequence and may take some time, especially if the table grows in size.

Is there any effective reordering method that does not require updating each record?

+4
source share
3 answers

I don’t understand why you think the problem is that you are updating 50 records when this is exactly what the user is doing. Also, if the table is really growing, how can the user change the order of the elements in the user interface if the computer cannot process it.

, , SQL EF .

+1

"" , decimal, - 1 100.

100 50 "" (49 + 50)/2, 100 49 50. "" .

+1

.

, .

. , .

.

0

All Articles