// Creates new incident public Boolean SetNewIncident(IncidentModel incident) { var collection = ConfigDB.GetDatabase().GetCollection <IncidentModel>("Incidents"); collection.InsertOne(incident); return(true); }
/// <summary> /// set new key with email and key in the DB /// </summary> /// <param name="key"></param> /// <param name="email"></param> public void SetKey(string key, string email) { KeyModel keyModel = new KeyModel() { Email = email, Key = key }; var collection = ConfigDB.GetDatabase().GetCollection <KeyModel>("ResetKey"); collection.InsertOne(keyModel); }
//Insert single user public void InsertUser(UserModel user) { //Select collection var collection = ConfigDB.GetDatabase().GetCollection <UserModel>("Users"); collection.InsertOne(user); }