Below is my scenario. I am trying to associate the types to the interfaces by using the Export functionality during the initial bootstrap. However, MEF complains on ImportCardinalityMismatchException.I am fairly new to MEF and I couldn't figure out what's wrong here? The easiest fix is to remove the inheritance. However, I would like to avoid it.
public interface IColourService
{
Color GetColourByCountry(string countryName);
}
public interface IKnownColourService:IColourService
{
bool IsKnownCountry(string countryName);
}
public interface IUnKnownColourService:IColourService
{
bool IsUnKnownCountry(string countryName);
}
[Export(typeof(IColourService))]
public class ColourService:IColourService
{
//implementation
}
[Export(typeof(IKnownColourService))]
public class KnownColourService:IKnownColourService
{
//implementation
}
[Export(typeof(IUnKnownColourService))]
public class UnknownColourService:IUnKnownColourService
{
//implementation
}