/// <summary> /// サービスをコンテナに登録します。 /// </summary> /// <param name="services"></param> private static async Task ConfigureServices(ServiceCollection services) { string clientSecret; string clientId; { IConfigService service = await ConfigService.Get(); clientId = service.ClientId; clientSecret = service.ClientSecret; services.AddSingleton(provider => service); } { ITypeTalkConnection service = TypeTalkConnection.Create("https://typetalk.com", clientId, clientSecret); await service.Login(); services.AddSingleton(provider => service); } services.AddSingleton <ILayoutRepository>(new LayoutRepository()); services.AddTransient <ISpaceService, SpaceService>(); services.AddTransient <ITopicService, TopicService>(); }
public TopicService(ITypeTalkConnection typetalkConnection) { _typetalkConnection = typetalkConnection; }
public SpaceService(ITypeTalkConnection typetalkConnection) { _typetalkConnection = typetalkConnection; }