Exemplo n.º 1
0
        public static void add_prophecy(prophecy prop)
        {
            var store = new DataStore("prophecy.json");

            // Get employee collection
            store.GetCollection <prophecy>().InsertOneAsync(prop);

            store.Dispose();
        }
Exemplo n.º 2
0
        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);
            }
        }