using System; using System.Collections.Generic; using System.Threading.Tasks; using PetaPoco.Business; namespace Sony.Filtr.Core.SpotifyUserFollowers { public class SpotifyUserFollowersManager { public async Task> GetFollowerDataAsync(string spotifyUsername, DateTime? startDate, DateTime? endDate) { var sql = PetaPoco.Sql.Builder.Append("WHERE UserId = @0 AND (@1 IS NULL OR Date >= @1) AND (@2 IS NULL OR Date <= @2)", spotifyUsername, startDate, endDate); return PetaPocoRepository.ReadOnlyInstance.Fetch(sql); } public async Task> GetFollowerDataAsync(DateTime date) { var sql = PetaPoco.Sql.Builder.Append("WHERE Date = @0", date); return PetaPocoRepository.ReadOnlyInstance.Fetch(sql); } } }