Most of my application uses the requested queries to retrieve data. In these queries, I often refer to the current user. I notice that if user, B, logs in after another user, A, then user B will see the information of user A.
I have queries similar to all this through the app
public static Func<DataContext, MyRecord> CurrentUserRecords =
CompiledQuery.Compile<DataContext, MyRecord>(
(DataContext db) =>
(from r in db.MyRecords
where
r.User == User.Current
select r).SingleOrDefault());
User.Current is a static property that changes depending on who is logged in.
public static User Current
{
get { return MyBase<User>.Get((int)(HttpContext.Current.Session["CurrentUserID"] ?? 0)); }
}
User A, User A. , User.Current A. , B, - User A, , User.Current B.
Profiler SQL Server , TSQL, A, .
, :
- ?
, , ?
" " ASP.net?
!