IFeatureChecker.cs 1.1 KB

12345678910111213141516171819202122232425262728
  1. using System.Threading.Tasks;
  2. using Abp.Runtime.Session;
  3. namespace Abp.Application.Features
  4. {
  5. /// <summary>
  6. /// This interface should be used to get the value of features
  7. /// </summary>
  8. public interface IFeatureChecker
  9. {
  10. /// <summary>
  11. /// Gets the value of a feature by its name.
  12. /// This is a shortcut for <see cref="GetValueAsync(int, string)"/> that uses <see cref="IAbpSession.TenantId"/> as tenantId.
  13. /// Note: This method should only be used if a TenantId can be obtained from the session.
  14. /// </summary>
  15. /// <param name="name">Unique feature name</param>
  16. /// <returns>Feature's current value</returns>
  17. Task<string> GetValueAsync(string name);
  18. /// <summary>
  19. /// Gets the value of a feature for a tenant by the feature's name.
  20. /// </summary>
  21. /// <param name="tenantId">Tenant's Id</param>
  22. /// <param name="name">Unique feature name</param>
  23. /// <returns>Feature's current value</returns>
  24. Task<string> GetValueAsync(int tenantId, string name);
  25. }
  26. }