Exemplo n.º 1
0
 public static FileLogger GetLogger()
 {
     if(isCreate)
         return logger;
     else
     {
         logger = new FileLogger();
         return logger;
     }
 }
Exemplo n.º 2
0
 public SearchHashForm(string collectionName = "HashForm", string dbName = "emdsdb", string hostIP = "localhost")
 {
     connectionString = String.Format("mongodb://{0}/?safe=true", hostIP);
     try
     {
         server = MongoServer.Create(connectionString);
         database = server.GetDatabase(dbName);
         collection = database.GetCollection<FormHash>(collectionName);
         server.Ping();
     }
     catch
     {
         throw new Exception("Проблема подключением к монге");
     }
     log = FileLogger.GetLogger();
 }