using Flypaper.Core; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace Flypaper.Storage; public static class FlypaperStorageExtensions { public static IServiceCollection AddFlypaperStorage(this IServiceCollection services, string connectionString) { services.AddDbContextFactory(options => options.UseSqlite(connectionString)); services.AddSingleton(); services.AddSingleton(sp => sp.GetRequiredService()); services.AddHostedService(); return services; } }