public static void add_prophecy(prophecy prop) { var store = new DataStore("prophecy.json"); // Get employee collection store.GetCollection <prophecy>().InsertOneAsync(prop); store.Dispose(); }
public static prophecy get_prophecy(string stringId) { if (int.TryParse(stringId, out int id)) { var store = new DataStore("prophecy.json"); prophecy toReturn = store.GetCollection <prophecy>().AsQueryable().FirstOrDefault(e => e.ID == id); store.Dispose(); return(toReturn); } else { return(null); } }