donderdag 22 juli 2010

ASP.NET & LINQ Viewstate

A small issue I ran across when building a ASP.NET website was that a lot of pages contained LINQ datasources on them which started to tax the performance of the website. A large factor in boosting the performance was disabling the viewstate on all of the LINQ datasources. At first this resulted in a lot of exceptions whenever the datasource needed updating, which was due to LINQ using the values stored in the viewstate for version checking with the current data.

This problem was solved by adding a timestamp column to each table. If a table has a timestamp column LINQ will disable update checking on all other columns and use only the timestamp column for version checking.

Geen opmerkingen:

Een reactie posten