You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Services.Api/ApiServicesRegistrationExte...

24 lines
701 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using Autofac;
using MongoDB.Driver;
using NzbDrone.Services.Api.Datastore;
namespace NzbDrone.Services.Api
{
public static class ApiServicesRegistrationExtention
{
public static ContainerBuilder RegisterApiServices(this ContainerBuilder containerBuilder)
{
containerBuilder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly()).SingleInstance();
containerBuilder.Register(c => c.Resolve<Connection>().GetMainDb())
.As<MongoDatabase>().SingleInstance();
return containerBuilder;
}
}
}