I am using a base class for my collections. All of my tables have the column "UseId" which is an integer column. I would like to override the "LoadAll()" method in my base class so that I can ensure the data I load for any given collection only returns the ID of the current user.
Here is my base class:
Code:
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using EntitySpaces.Core;
5 using EntitySpaces.Interfaces;
6
7 namespace DaymarkSoftware.iRaceMark.DAL {
8 public class CollectionBase : esEntityCollection {
9
10 public DotNetNuke.Entities.Users.UserInfo DNNUserInfo {
11 get { return DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo(); }
12 }
13
14 public override bool LoadAll() {
15 // TODO: Add logic to always filter on user id.
16 return base.LoadAll();
17 }
18 }
19 }
20
I would like to do something like:
Code:
1 public override bool LoadAll() {
2 es.Query.Where(es.Meta.Columns["UserID"].Equals(DNNUserInfo.UserID));
3 return es.Query.Load();
4 }