示例#1
0
        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();
        }
示例#2
0
 public void AddDownloadTransaction(DownloadTransaction trans)
 {
     applicationDbContext.DownloadTransactions.Add(trans);
     applicationDbContext.SaveChanges();
 }