Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class GlobalDB
- {
- EntityTables DatabaseInstance; //imaginary singleton
- }
- public class EntityTables
- {
- //imagine this is a singleton
- public IQueryable<User> UserTable
- {
- get
- {
- DB.instance.GetAllUsers();
- }
- }
- }
- public class User
- {
- public int userID {get; set;}
- List<UserBook> UserBooks
- {
- get
- {
- DB.instance.GetUserBooksByUserID(userID);
- }
- }
- }
- public class anotherClassSomewhere
- {
- User currentUser =
- GlobalDB.DatabaseInstance.UserTable.Where(u => u.userID == 4).SingleOrDefault();
- }
Add Comment
Please, Sign In to add comment