I'm using ASP.NET MVC and Entity Framework 6 for my online store. I am saving the count of views at the first line of my product page with this code :
vmProduct.product.seenCount = Convert.ToInt32(vmProduct.product.seenCount) + 1; db.SaveChanges(); and in the list of products page sort the list by seenCount column.
But when my site have many requests, product table locked because of adding count to product and any other queries goes to wait in SQL Server, so my site not load for some minutes, and if I comment the code my problem solved.
Is there any way to disable or prevent of locking product table when adding count to it? or what is the solution here?