I´m working on simple CMS in ASP .NET MVC 5 with Entity Framework. I have a few questions about concurrency in MVC´s applications.
First of all - public section of my app (section for users without any authentification):
All data (posts, category informations, tags, documents) are stored in DB (using Entity)
In controllers for public section, there is only reading or writing data to DB, not deleting or editing
So my first question - is it necessary to have some mechanisms to avoid concurrency dangers in public section? Will everything be correct when multiple users will be browsing my website at the same time?
And then my admin section (authentification needed):
- There can be multiple users with multiple roles (but in real there will be only few registered users)
- Users can create/edit/delete data in DB
I know that some security mechanism are necessary to have safe system, but can you help me how to do this?
I´m also using this pattern for DbContext in each method, where DB is necessary:
using (var db = new CmsContext())
{
// other stuff here
}
Instead of one class variable db that is used in all methods. Is this right?
Many thanks for answers!