I have an ASP.net site that is essentially just a user interface for a class library I created. Each of the classes in this class library contain a static definition class with static references to compiled queries.
Like so:
class MyRecord
{
/*Some Properties,Fields, and Methods*/
internal static class Queries
{
public static Func<MyDataContext, MyRecord> ACompiledQuery =
CompiledQuery.Compile<MyDataContext, MyRecord>(
(MyDataContext db) =>
from mr in db.MyRecords
select mr);
}
}
Given this structure and given that each web page references this library, I have a couple questions
Question 1: Every request to an IIS web server essentially starts a new thread, correct?
Question 2: If so, does this mean that for every request I end up recompiling these querries?
Question 3: Is there anyway to reduce the amount of times I recompile these querries?