/// <summary> /// This creates a timestamp. Fun stuff. /// </summary> 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); } }
/// <summary> /// Processes the list of Gods into the correct tables. /// </summary> /// <param name="pGods">List of Gods</param> 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); } }
/// <summary> /// Processes the list of items into the correct tables. /// </summary> /// <param name="pGods">List of items</param> 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); } }