Ejemplo n.º 1
0
        public static void Init()
        {
            var pings = DB.GetCollection <Ping>("pings");
            var count = pings.Count(Query.All());

            if (count == 0)
            {
                // Create your new ping instance
                var demoData = DemoService.GetBaltimoreDemo();
                pings.InsertBulk(demoData);
            }
        }
Ejemplo n.º 2
0
        public static Ping GetPingById(string id)
        {
            // Get customer collection
            var pings = DB.GetCollection <Ping>("pings");
            var count = pings.Count(Query.All());

            if (count == 0)
            {
                // Create your new customer instance
                var demoData = DemoService.GetBaltimoreDemo();
                pings.InsertBulk(demoData);
            }
            return(pings.FindById(id));
        }