Beispiel #1
0
 public SQLiteRepository(
     [System.Diagnostics.CodeAnalysis.NotNull]
     SQLiteRepositoryOptions options)
 {
     _database = options.Connection ?? new SQLiteConnection(options.ConnectionString);
     _database.CreateTable <TItem>();
     IsInitialized = true;
 }
    public static IServiceCollection AddSQLite(this IServiceCollection serviceCollection, Action <SQLiteRepositoryOptions> action)
    {
        var connectionOptions = new SQLiteRepositoryOptions();

        action.Invoke(connectionOptions);

        serviceCollection.AddSingleton(connectionOptions);

        return(serviceCollection);
    }