mirror of
https://github.com/Radarr/Radarr
synced 2024-12-28 02:40:01 +00:00
b7575e05c1
More DailySeries repo work done
25 lines
No EOL
703 B
C#
25 lines
No EOL
703 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using MongoDB.Driver;
|
|
|
|
namespace NzbDrone.Services.Api.Datastore
|
|
{
|
|
public class Connection
|
|
{
|
|
public MongoDatabase GetMainDb()
|
|
{
|
|
var db = GetMongoDb(ConfigurationManager.ConnectionStrings["MongoLab"].ConnectionString, "services-dev");
|
|
return db;
|
|
}
|
|
|
|
public MongoDatabase GetMongoDb(string connectionString, string dbName)
|
|
{
|
|
var mongoServer = MongoServer.Create(connectionString);
|
|
var database = mongoServer.GetDatabase(dbName.ToLowerInvariant());
|
|
return database;
|
|
}
|
|
}
|
|
} |