NullFeatureValueStore.cs 769 B

1234567891011121314151617181920212223
  1. using System.Threading.Tasks;
  2. namespace Abp.Application.Features
  3. {
  4. /// <summary>
  5. /// Null pattern (default) implementation of <see cref="IFeatureValueStore"/>.
  6. /// It gets null for all feature values.
  7. /// <see cref="Instance"/> can be used via property injection of <see cref="IFeatureValueStore"/>.
  8. /// </summary>
  9. public class NullFeatureValueStore : IFeatureValueStore
  10. {
  11. /// <summary>
  12. /// Gets the singleton instance.
  13. /// </summary>
  14. public static NullFeatureValueStore Instance { get; } = new NullFeatureValueStore();
  15. /// <inheritdoc/>
  16. public Task<string> GetValueOrNullAsync(int tenantId, Feature feature)
  17. {
  18. return Task.FromResult((string) null);
  19. }
  20. }
  21. }