There is a site on ASP.Net mvc. The site displays the status of multiple devices. Devices write regardless of the site values in the database (mysql). The page is a hodgepodge. In View there is one connected model, but this model contains a list of all objects. For example:
public class SyObVM { // список городов public IEnumerable<CVM> Cities { get; set; } //сообщения public IEnumerable<Ev> Events { get; set; } таких коллекций несколько } All these collections are collected in the controller and transferred to the View.
It is necessary to implement the following scheme: The user logged in, a page was displayed, a certain table was checked once every n seconds, whether something new appeared there, if the information was added / changed, it is necessary to update the whole page and signal it to the user.
In the database previously made a trigger that writes to another table, the time and the last identifier.
I don’t know how in asp net mvc to compare the old state with the new one from the database and so on each cycle and accordingly interact with the view.
If the application were desktop, I remembered the value at the start, then every n seconds I would take the current one from the required table, compare the values, if I change, notify and change the starting one, if not, continue ...
Probably need a bunch of JS / Ajax .. but experience on the web is not enough.
