コード例 #1
0
 public void CreateUpdateTimestamp()
 {
     try
     {
         using (var db = new SmiteContext())
         {
             db.UpdateTracker.Add(new UpdateTracker
                 {
                     TimeStamp = DateTime.UtcNow
                 });
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
 public void ProcessGods(List<God> pGods)
 {
     try
     {
         pGods = AddGodImageUrls(pGods);
         using (var db = new SmiteContext())
         {
             foreach (var god in pGods)
             {
                 db.Gods.Add(god);
             }
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #3
0
 public void ProcessItems(List<Item> pItems)
 {
     try
     {
         pItems = AddItemImageUrls(pItems);
         using (var db = new SmiteContext())
         {
             foreach (var item in pItems)
             {
                 db.Items.Add(item);
             }
             db.SaveChanges();
             db.Database.Connection.Close();
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }