mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
21 lines
762 B
C#
21 lines
762 B
C#
|
using BililiveRecorder.Core;
|
||
|
using BililiveRecorder.Core.Config.V2;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
|
||
|
namespace BililiveRecorder.DependencyInjection
|
||
|
{
|
||
|
public static class DependencyInjectionExtensions
|
||
|
{
|
||
|
public static void AddCore(this IServiceCollection services)
|
||
|
{
|
||
|
services.AddSingleton<IRecorder, Recorder>();
|
||
|
#pragma warning disable IDE0001
|
||
|
services.AddSingleton<ConfigV2>(x => x.GetRequiredService<IRecorder>().Config);
|
||
|
services.AddSingleton<GlobalConfig>(x => x.GetRequiredService<ConfigV2>().Global);
|
||
|
#pragma warning restore IDE0001
|
||
|
services.AddSingleton<BililiveAPI>();
|
||
|
services.AddSingleton<IRecordedRoomFactory, RecordedRoomFactory>();
|
||
|
}
|
||
|
}
|
||
|
}
|