2023-04-19 19:28:58 +00:00
|
|
|
using Elsa.Features.Contracts;
|
|
|
|
|
using Elsa.Features.Models;
|
|
|
|
|
|
|
|
|
|
namespace Elsa.Features.Services;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public class InstalledFeatureRegistry : IInstalledFeatureRegistry
|
|
|
|
|
{
|
2024-07-05 13:14:28 +00:00
|
|
|
private readonly Dictionary<string, FeatureDescriptor> _descriptors = new();
|
2023-04-19 19:28:58 +00:00
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2023-07-25 13:12:27 +00:00
|
|
|
public void Add(FeatureDescriptor descriptor) => _descriptors[descriptor.FullName] = descriptor;
|
2023-04-19 19:28:58 +00:00
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2023-07-25 13:12:27 +00:00
|
|
|
public IEnumerable<FeatureDescriptor> List() => _descriptors.Values;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2024-07-05 13:14:28 +00:00
|
|
|
public FeatureDescriptor? Find(string fullName) => _descriptors.GetValueOrDefault(fullName);
|
2023-04-19 19:28:58 +00:00
|
|
|
}
|