V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
namespace Shared.Operations;
|
||||
|
||||
public interface IWorkItemActionHandler
|
||||
{
|
||||
string Key { get; }
|
||||
Task ExecuteAsync(string tenantId, string actorId, Guid workItemId, CancellationToken ct);
|
||||
}
|
||||
|
||||
public sealed class WorkItemActionRegistry(IEnumerable<IWorkItemActionHandler> handlers)
|
||||
{
|
||||
private readonly IReadOnlyDictionary<string, IWorkItemActionHandler> _handlers =
|
||||
handlers.ToDictionary(x => x.Key, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public bool TryGet(string key, out IWorkItemActionHandler? handler) => _handlers.TryGetValue(key, out handler);
|
||||
}
|
||||
Reference in New Issue
Block a user