1

This is probalby really simple and I have just looked at it too long. In my project I have a Contracts.cs with the following code:

namespace RC.Common.Core.ProcessPlugin
{
    public class Contracts
    {
        public interface IProcessPlugin
        {
            void RunProcess(int jobID);
        }

        public interface IProcessMetaData
        {
            string Process { get; }
        }
    }
}

And then I have PluginProcessFactory.cs with this as some of its code:

namespace RC.Common.Core.ProcessPlugin
{
    public class PluginProcessFactory
    {
        [ImportMany]
        IEnumerable<Lazy<Contracts.IProcessPlugin, Contracts.IProcessMetaData>> processes;

        // more code
    }
}

How can I get it so that the references to the interfaces in the IEnumerable don't contain the class reference in the name? So it looks like this:

        IEnumerable<Lazy<IProcessPlugin, IProcessMetaData>> processes;
4

1 回答 1

1

不要将接口放在类中:

namespace RC.Common.Core.ProcessPlugin
{
    // Place directly in namespace
    // public class Contracts
    // {
        public interface IProcessPlugin
        {
            void RunProcess(int jobID);
        }

        public interface IProcessMetaData
        {
            string Process { get; }
        }
    // }
}
于 2013-10-30T00:10:44.640 回答