|
|
|
@ -1,9 +1,7 @@ |
|
|
|
using JetBrains.Annotations; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
@ -19,19 +17,20 @@ namespace Volo.CmsKit.Tags |
|
|
|
this.options = options.Value; |
|
|
|
} |
|
|
|
|
|
|
|
public Task<TagDefiniton> GetTagDefinitionOrNullAsync([NotNull] string entityType) |
|
|
|
public virtual Task<TagDefiniton> GetTagDefinitionOrNullAsync([NotNull] string entityType) |
|
|
|
{ |
|
|
|
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); |
|
|
|
return Task.FromResult(options.Tags.GetOrDefault(entityType)); |
|
|
|
} |
|
|
|
|
|
|
|
public Task<List<TagDefiniton>> GetTagDefinitionsAsync() |
|
|
|
public virtual Task<List<TagDefiniton>> GetTagDefinitionsAsync() |
|
|
|
{ |
|
|
|
return Task.FromResult(options.Tags.Values.ToList()); |
|
|
|
} |
|
|
|
|
|
|
|
public Task<bool> IsDefinedAsync([NotNull] string entityType) |
|
|
|
public virtual Task<bool> IsDefinedAsync([NotNull] string entityType) |
|
|
|
{ |
|
|
|
Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); |
|
|
|
return Task.FromResult(options.Tags.ContainsKey(entityType)); |
|
|
|
} |
|
|
|
} |
|
|
|
|