Answer the question
In order to leave comments, you need to log in
Where to store temporary data in ASP.NET MVC?
Good afternoon!
I'm involved in the development of a calculation application hosted entirely on the Web. The application is engaged in the fact that, under the parameters specified by the user, it selects equipment, while maintaining all intermediate calculation values.
It looks like this: the user enters data, a window appears with a list of selected equipment. When choosing equipment, the user is shown its settings through Ajax, calculated based on the entered data.
However, a problem arises here - the Ajax request is made asynchronously, i.e. in another thread that does not see calculation objects from the first thread.
Question: where to store such data?
Right into the database? But the user needs only one equipment from the list of selected ones, so the question arises how to clear unnecessary data after the session ends. In a static ConcurrentDictionary? Cleaning is simpler, but also some kind of bad approach, it seems to me. Immediately transfer the contents of the entire calculation to the user? But there can be 5000+ elements and the page with the results starts to weigh a lot.
What are the best practices for implementing something like this? Where to dig? What to read?
Thank you.
Answer the question
In order to leave comments, you need to log in
> Сразу в БД?
Почему нет? Только не в основную, а например в Redis (polyglot persistence)
Вы спросите нафига вам оно? Вот вам аргумент :).
Здравствуйте!
В ASP.NET MVC есть такой объект как TempData, может он Вам подойдет?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question