Skip to content

Commit

Permalink
fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
kinosang committed Jan 4, 2023
1 parent 17af49d commit 2177369
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Packages.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>

<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="5.0.0" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.0" />
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="6.0.12" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.8" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ public static IServiceCollection AddEntityFrameworkPGroonga(
this IServiceCollection serviceCollection)
{
new EntityFrameworkRelationalServicesBuilder(serviceCollection)
.TryAddProviderSpecificServices(
x => x
.TryAddSingletonEnumerable<IMethodCallTranslatorPlugin, PGroongaMethodCallTranslatorPlugin>()
.TryAddSingletonEnumerable<IEvaluatableExpressionFilterPlugin, PGroongaEvaluatableExpressionFilterPlugin>());
.TryAdd<IMethodCallTranslatorPlugin, PGroongaMethodCallTranslatorPlugin>()
.TryAdd<IEvaluatableExpressionFilterPlugin, PGroongaEvaluatableExpressionFilterPlugin>();

return serviceCollection;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public ExtensionInfo(IDbContextOptionsExtension extension)

public override bool IsDatabaseProvider => false;

public override long GetServiceProviderHashCode() => 0;
public override int GetServiceProviderHashCode() => 0;

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other) => true;

public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
=> debugInfo["Npgsql:" + nameof(PGroongaDbContextOptionsBuilderExtensions.UsePGroonga)] = "1";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ public PGroongaMethodCallTranslator(SqlExpressionFactory sqlExpressionFactory, I
}

_sqlExpressionFactory = sqlExpressionFactory;
_boolMapping = typeMappingSource.FindMapping(typeof(bool));
_boolMapping = typeMappingSource.FindMapping(typeof(bool))!;
}

/// <inheritdoc />
public SqlExpression? Translate(SqlExpression instance, MethodInfo method, IReadOnlyList<SqlExpression> arguments, IDiagnosticsLogger<DbLoggerCategory.Query> logger)
public virtual SqlExpression? Translate(
SqlExpression? instance,
MethodInfo method,
IReadOnlyList<SqlExpression> arguments,
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
{
if (method == null)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PGroongaTests/PGroongaTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2177369

Please sign in to comment.