Dependency Injection. Assign values to IENUMERABLE

Posted by Boss on Stack Overflow See other posts from Stack Overflow or by Boss
Published on 2011-01-12T00:32:38Z Indexed on 2011/01/12 4:54 UTC
Read the original article Hit count: 145

Filed under:
|
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;
    }
}

I am new to this field. My question is how to assign values to EnabledFeatures?

Thanks Jeco

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc-3