mirror of https://github.com/abpframework/abp.git
2 changed files with 17 additions and 4 deletions
@ -1,15 +1,28 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.GlobalFeatures |
|||
{ |
|||
[AttributeUsage(AttributeTargets.Class)] |
|||
public class RequiresGlobalFeatureAttribute : Attribute |
|||
{ |
|||
public Type FeatureType { get; } |
|||
public Type Type { get; } |
|||
|
|||
public RequiresGlobalFeatureAttribute(Type featureType) |
|||
public string Name { get; } |
|||
|
|||
public RequiresGlobalFeatureAttribute([NotNull] Type type) |
|||
{ |
|||
Type = Check.NotNull(type, nameof(type)); |
|||
} |
|||
|
|||
public RequiresGlobalFeatureAttribute([NotNull] string name) |
|||
{ |
|||
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
|||
} |
|||
|
|||
public virtual string GetFeatureName() |
|||
{ |
|||
FeatureType = featureType; |
|||
return Name ?? GlobalFeatureNameAttribute.GetName(Type); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue