using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using PetaPoco.Business; namespace Sony.Filtr.Tasks.Tasks.Spotify { public class SpotifyArtistMonthlyListenerManager { public async Task SaveMonthlyListenersAsync(string artistId, DateTime today, long monthlyListeners, long monthlyListenersDelta) { var entry = new SpotifyArtistMonthlyListenerLogEntry() { ArtistId = artistId, Date = today, MonthlyListeners = monthlyListeners, MonthlyListenersDelta = monthlyListenersDelta }; PetaPocoRepository.Instance.Insert(entry); } public List GetEntries(DateTime date) { return PetaPocoRepository.Instance.Fetch("WHERE Date = @0", date); } } }