public interface IFeature
{
string FeatureName { get; set; }
}
public interface IFeatureRegistry
{
IEnumerable<IFeature> Features { get; set; }
bool IsEnabled(IEnumerable<string> featurePath);
}
public interface IApplicationTenant
{
string ApplicationName { get; }
IFeatureRegistry EnabledFeatures { get; }
}
public abstract class AbstractApplicationTenant : IApplicationTenant
{
public string ApplicationName { get; protected set; }
public IFeatureRegistry EnabledFeatures { get; protected set; }
}
public class SampleTenant : AbstractApplicationTenant
{
public SampleTenant()
{
ApplicationName = "Sample 1";
EnabledFeatures = null;
}
}
我是这个领域的新手。我的问题是如何将值分配给EnabledFeatures
?依赖注入。将值分配给IENUMERABLE
感谢 捷虹
请至少格式化您的代码。 – 2011-01-12 00:38:18