Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Casbin.Persist.Adapter.EFCore.UnitTest/SpecialPolicyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Casbin.Persist.Adapter.EFCore.Entities;
using Casbin.Persist.Adapter.EFCore.UnitTest.Fixtures;
using Xunit;
using System;

namespace Casbin.Persist.Adapter.EFCore.UnitTest
{
Expand Down Expand Up @@ -40,7 +41,8 @@ public void TestCommaPolicy()
m = eval(p.rule)
"""
), adapter);
enforcer.AddFunction("equal", (a1, a2) => a1 == a2);

enforcer.AddFunction<Func<object, object, bool>>("equal", (a1, a2) => a1 == a2);

enforcer.AddPolicy("equal(p.a1, p.a2)", "a1", "a1");
Assert.True(enforcer.Enforce("_"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Casbin.NET" Version="2.7.0" />
<PackageReference Include="Casbin.NET" Version="2.16.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public virtual void Configure(EntityTypeBuilder<EFCorePersistPolicy<TKey>> build
builder.Ignore(p => p.Value10);
builder.Ignore(p => p.Value11);
builder.Ignore(p => p.Value12);
builder.Ignore(p => p.Value13);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties need be added to PersistPolicy and IPersistPolicy at Casbin.NET

Copy link
Author

@stewartmcguire stewartmcguire Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They already exist in the 2.16.0 release of Casbin.NET which I indicated I updated the Casbin.NET library reference to.

builder.Ignore(p => p.Value14);

builder.HasIndex(p => p.Type);
builder.HasIndex(p => p.Value1);
Expand Down
Loading