public void UpdateDownloadTransaction(DownloadTransaction trans) { DownloadTransaction dbEntry = applicationDbContext.DownloadTransactions.FirstOrDefault(d => d.Token == trans.Token); if (dbEntry != null) { dbEntry.UserId = trans.UserId; dbEntry.SongId = trans.SongId; dbEntry.Expiration = trans.Expiration; dbEntry.HasDownloaded = trans.HasDownloaded; } applicationDbContext.SaveChanges(); }
public void AddDownloadTransaction(DownloadTransaction trans) { applicationDbContext.DownloadTransactions.Add(trans); applicationDbContext.SaveChanges(); }