Closed QianMoXi closed 9 months ago
There is no need to specify exact provider for sqlite, but agree that we should accept specific name too
@MaceWindu I set it because my app is published as a single file, and the following code cannot correctly detect the assembly I am using
I can solve the problem with SQL server in this way, but it does not work for sqlite
optionsBuilder.UseLinqToDB(x => x.AddCustomOptions(o => o.UseSqlServer(SqlServerVersion.v2008, SqlServerProvider.MicrosoftDataSqlClient)))
I've found a solution to this problem:
optionsBuilder.UseLinqToDB(x => x.AddCustomOptions(o => o.UseDataProvider(SQLiteTools.GetDataProvider(ProviderName.SQLiteMS))))
Register:
optionsBuilder.UseLinqToDB(x => x.AddCustomOptions(o => o.UseSQLiteMicrosoft()))
When creating a connection, will throw an exception:
dbContext.CreateLinqToDBConnection()
Is this provider not supported or did you forget to add it?
https://github.com/linq2db/linq2db.EntityFrameworkCore/blob/44de54e460309d3790a8eba8fc3375276201c93f/Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsImplDefault.cs#L181-L182