修复Mysql
This commit is contained in:
@@ -52,6 +52,25 @@ public sealed class MySqlMigrationTests
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MySql_guid_collections_use_provider_safe_predicates()
|
||||
{
|
||||
using var db = new AppDbContext(CreateMySqlOptions());
|
||||
var ids = new[]
|
||||
{
|
||||
Guid.Parse("11111111-1111-1111-1111-111111111111"),
|
||||
Guid.Parse("22222222-2222-2222-2222-222222222222")
|
||||
};
|
||||
|
||||
var sql = db.Colleges
|
||||
.WhereIn(ids, x => x.Id)
|
||||
.ToQueryString();
|
||||
|
||||
Assert.Contains(" IN (", sql, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.Contains(ids[0].ToString(), sql, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.Contains(ids[1].ToString(), sql, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private static DbContextOptions<AppDbContext> CreateMySqlOptions() =>
|
||||
new DbContextOptionsBuilder<AppDbContext>()
|
||||
.UseMySQL(
|
||||
|
||||
Reference in New Issue
Block a user