Skip to content

Commit

Permalink
Fix: #423
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Oct 13, 2022
1 parent 4194a95 commit 7fd064b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uSync8.BackOffice/SyncHandlers/SyncHandlerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public IEnumerable<string> GetValidGroups(SyncHandlerOptions options = null)
{
var handlers = GetValidHandlers(options);
var groups = handlers
.Select(x => x.Handler.Group)
.Select(x => GetHandlerGroup(x))
.ToList();

groups.AddRange(handlers.Where(x => !string.IsNullOrWhiteSpace(x.Settings.Group))
Expand All @@ -129,6 +129,11 @@ public IEnumerable<string> GetValidGroups(SyncHandlerOptions options = null)
return groups.Distinct();
}

private string GetHandlerGroup(ExtendedHandlerConfigPair handlerConfigPair)
=> !string.IsNullOrWhiteSpace(handlerConfigPair.Settings.Group)
? handlerConfigPair.Settings.Group
: handlerConfigPair.Handler.Group;

public IEnumerable<ExtendedHandlerConfigPair> GetValidHandlers(string[] aliases, SyncHandlerOptions options = null)
=> GetValidHandlers(options)
.Where(x => aliases.InvariantContains(x.Handler.Alias));
Expand Down

0 comments on commit 7fd064b

Please sign in to comment.