Created
October 1, 2018 16:48
-
-
Save codehaks/7e19f5e4a545c4f987d244640868c334 to your computer and use it in GitHub Desktop.
LiteDb Service for ASP.NET Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Options; | |
namespace BugPages.Common | |
{ | |
public static class LiteDbServiceExtention | |
{ | |
public static void AddLiteDb(this IServiceCollection services,string databasePath) | |
{ | |
services.AddTransient<LiteDbContext, LiteDbContext>(); | |
services.Configure<LiteDbConfig>(options => options.DatabasePath = databasePath); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment