LiteDbServiceExtension.cs 403 B

1234567891011121314
  1. using Microsoft.Extensions.DependencyInjection;
  2. using Microsoft.Extensions.Options;
  3. namespace api.Database
  4. {
  5. public static class LiteDbServiceExtension
  6. {
  7. public static void AddLiteDb(this IServiceCollection services, string databasePath)
  8. {
  9. services.AddTransient<LiteDbContext, LiteDbContext>();
  10. services.Configure<LiteDbConfig>(options => options.DatabasePath = databasePath);
  11. }
  12. }
  13. }