KoogleApp/src/Koogle.Application/DependencyInjection.cs

51 lines
2.7 KiB
C#

using Koogle.Application.Games;
using Koogle.Application.Interfaces;
using Koogle.Application.Services;
using Koogle.Domain.Interfaces;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Koogle.Application
{
public static class DependencyInjection
{
public static IServiceCollection AddApplication(this IServiceCollection services)
{
// Game Framework
services.AddGameFramework();
// AutoMapper
services.AddAutoMapper(cfg => cfg.LicenseKey = "eyJhbGciOiJSUzI1NiIsImtpZCI6Ikx1Y2t5UGVubnlTb2Z0d2FyZUxpY2Vuc2VLZXkvYmJiMTNhY2I1OTkwNGQ4OWI0Y2IxYzg1ZjA4OGNjZjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2x1Y2t5cGVubnlzb2Z0d2FyZS5jb20iLCJhdWQiOiJMdWNreVBlbm55U29mdHdhcmUiLCJleHAiOiIxNzk3MjkyODAwIiwiaWF0IjoiMTc2NTgyNzkzMyIsImFjY291bnRfaWQiOiIwMTliMjM4YjYxZGM3MWYwOTAyYmY5OGU0NzNmOTY5ZSIsImN1c3RvbWVyX2lkIjoiY3RtXzAxa2NocnF3dHNkczM4cjJnOTBncmZ5ajA1Iiwic3ViX2lkIjoiLSIsImVkaXRpb24iOiIwIiwidHlwZSI6IjIifQ.ehnUm61bFyXv2s0RScHd3vV2wIRivFN-phslB65UxztWBsk1EAtqTgPT55ONQ6-k7zi7G1vpLUUz9NL4EfpMRwgl1obeCTrs1pzvIRkednzrSdcPKAOmil-xiCS1TlrvaLzLnBWCr0JroGrAmtMYjsfUpYayRx9x8BzjUGBPUvb6eUR6wSbEtPzZbycgsp4Oj4Wwi23o56UGWHdNz7R8ofKy9EyzrgiG1uYfJZUDB_B5uWtdWi5M2bfoYHcLj-7VbSJlVlW2RoETEYuylBjG0Bwg_ZtSoVsCuqi_qV_GuyBOKbPpjFK4NFcInYFkAxAyzV_uTaFQpCFukPpCMZpFtA",
Assembly.GetExecutingAssembly());
// Application Services
services.AddScoped<IUserService, UserService>();
services.AddScoped<ICurrentClubContext, CurrentClubContext>();
services.AddScoped<IClubService, ClubService>();
services.AddScoped<IPersonService, PersonService>();
services.AddScoped<IExpenseService, ExpenseService>();
services.AddScoped<IDayService, DayService>();
services.AddScoped<IPersonExpenseService, PersonExpenseService>();
services.AddScoped<IDashboardService, DashboardService>();
services.AddScoped<IEmailService, StubEmailService>();
services.AddScoped<ITriggerService, TriggerService>();
services.AddScoped<IGameEventService, GameEventService>();
services.AddScoped<IGamePersistenceService, GamePersistenceService>();
services.AddScoped<IPlayerStatisticsService, PlayerStatisticsService>();
services.AddScoped<IClubGifService, ClubGifService>();
// Note: Game types are registered in Koogle.Web where Blazor components are defined
// Use services.AddGameType<TDefinition, TLogicService>() to register game types
return services;
}
}
}