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); } }
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)); }