1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 17:59:14 +00:00
Radarr/NzbDrone.Services.Api/ApiServicesRegistrationExtention.cs

24 lines
701 B
C#
Raw Normal View History

2013-01-29 01:07:18 +00:00
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;
}
}
}