Beispiel #1
0
        public static async Task <List <Workout> > GetAllWorkouts(SQLiteAsyncConnection _connection)
        {
            var users = await UsersCredentials.GetAllUsers(_connection);

            var user = users[0];

            return(await _connection.Table <Workout>()
                   .Where(g => g.UserGuid == user.UserGuid)
                   .ToListAsync());
        }
Beispiel #2
0
        public static async Task <List <Workout> > GetAllWorkoutRecordsByDate(SQLiteAsyncConnection _connection, DateTime date)
        {
            var users = await UsersCredentials.GetAllUsers(_connection);

            var user = users[0];

            return(await _connection.Table <Models.Persistence.Workout>()
                   .Where(w => w.WorkoutDate == date)
                   .Where(g => g.UserGuid == user.UserGuid)
                   .ToListAsync());
        }
Beispiel #3
0
        public static async Task <List <Workout> > GetAllWorkoutRecordsForTheLast30Days(SQLiteAsyncConnection _connection)
        {
            var users = await UsersCredentials.GetAllUsers(_connection);

            var user = users[0];
            var date = DateTime.Now.AddDays(-30);

            return(await _connection.Table <Models.Persistence.Workout>()
                   .Where(w => w.WorkoutDate > date)
                   .Where(g => g.UserGuid == user.UserGuid)
                   .ToListAsync());
        }