Skip to content

Commit

Permalink
Merge pull request #101 from saritasa-nest/feature/SN-782-update-excl…
Browse files Browse the repository at this point in the history
…ude-all-entities-to-include-all-entities

Replace ExcludeAllEntities with IncludeAllEntities SN-782
  • Loading branch information
vasiliy-chefonov authored Nov 12, 2024
2 parents 1d81df6 + f3ef70b commit 25125ee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
NetForge:
uses: ./.github/workflows/pack-library.yml
with:
version_postfix: dev
version_postfix: dev-${{ github.run_number }}
15 changes: 4 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ jobs:
- name: Setup dotnet 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'

- name: Setup dotnet 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'

- name: Setup dotnet 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Checkout Source
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ You can exclude all entities and include only specific ones.
```csharp
services.AddNetForge(optionsBuilder =>
{
optionsBuilder.ExcludeAllEntities();
optionsBuilder.SetIncludeAllEntities(false);
optionsBuilder.IncludeEntities(typeof(Shop), typeof(Product));
});
```
Expand Down
6 changes: 3 additions & 3 deletions src/Saritasa.NetForge.Blazor/Domain/AdminOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ public AdminOptionsBuilder DisableCharactersTruncation()
}

/// <summary>
/// Excludes all tables by default.
/// Specifies whether to include all entities in the admin panel.
/// This method can be used in conjunction with <see cref="IncludeEntities"/>
/// or <see cref="NetForgeEntityAttribute"/> to include specific entities after excluding all.
/// </summary>
public AdminOptionsBuilder ExcludeAllEntities()
public AdminOptionsBuilder SetIncludeAllEntities(bool includeAllEntities)
{
options.ExcludeAllEntities = true;
options.IncludeAllEntities = includeAllEntities;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public class AdminOptions
public int TruncationMaxCharacters { get; set; } = 50;

/// <summary>
/// Whether to exclude all tables from the admin panel.
/// Whether to include all tables from the admin panel.
/// </summary>
public bool ExcludeAllEntities { get; set; }
public bool IncludeAllEntities { get; set; } = true;

/// <summary>
/// Entities to include in the admin panel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public IEnumerable<EntityMetadata> GetMetadata()
private static void ExcludeEntities(List<EntityMetadata> entityMetadatas, AdminOptions adminOptions)
{
// Exclude entities if it was specified in the admin options.
if (!adminOptions.ExcludeAllEntities)
if (adminOptions.IncludeAllEntities)
{
return;
}
Expand Down

0 comments on commit 25125ee

Please sign in to comment.