public UserDetailedInfoModel GetUserById(string ID)
        {
            var data = new BullsAndCowsData(new BullsAndCowsContext());
            var user = data.Users
                           .All()
                           .Where(u => u.Id == ID)
                           .Select(UserDetailedInfoModel.FromUser)
                           .FirstOrDefault();

            return user;
        }
        public IQueryable<UserShortInfoModel> GetUsers()
        {
            var data = new BullsAndCowsData(new BullsAndCowsContext());

            var users = data.Users
                            .All()
                            .OrderBy(u => u.UserName)
                            .Take(USERS_TO_TAKE_COUNT)
                            .Select(UserShortInfoModel.FromUser);

            return users;
        }
Exemple #3
0
 public Users()
 {
     this.data = new BullsAndCowsData(BullsAndCowsDbContext.Create());
 }