Ejemplo n.º 1
0
 public static DbSet SharedToDb(SharedSet sharedSet)
 {
     return(new DbSet
     {
         Id = sharedSet.Id,
         Code = sharedSet.Code,
         Name = sharedSet.Name,
         SetType = sharedSet.SetType,
         ReleasedAt = sharedSet.ReleasedAt,
         BlockCode = sharedSet.BlockCode,
         Block = sharedSet.Block,
         CardCount = sharedSet.CardCount
     });
 }
Ejemplo n.º 2
0
 public void CompleteSet(BigDeckPlays.Shared.Models.Set completedSet)
 {
     try
     {
         var dbSet = _db.Set.FirstOrDefault(s => s.Id == completedSet.Id);
         if (dbSet != null)
         {
             dbSet.Completed = true;
             _db.Set.Update(dbSet);
             _db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         System.Console.WriteLine($"Failed to update set {completedSet.Name}");
         System.Console.WriteLine(e.InnerException);
     }
 }