using FileSignatures; using FileSignatures.Formats; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using StopShopping.EF; using StopShopping.Services; using StopShopping.Services.Extensions; using StopShopping.Services.Implementions; namespace Microsoft.Extensions.DependencyInjection; public static class ServicesExtensions { public static IServiceCollection AddServices( this IServiceCollection services, Action dbContextOptions, IConfiguration appOptions, IConfiguration openPlatformOptions) { services.AddDbContext(dbContextOptions); services.Configure(appOptions); var imageFormats = FileFormatLocator.GetFormats().OfType(); var imageInspector = new FileFormatInspector(imageFormats); services.AddSingleton(imageInspector); services.AddSingleton(); services.AddSingleton(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddOpenPlatformServices(openPlatformOptions); return services; } }