Here's the example:
public interface IMessagePublishTopology
{
bool Exclude { get; }
}
public interface IMessagePublishTopologyConfigurator :
IMessagePublishTopology
{
new bool Exclude { set; }
}
public static class Test
{
public static void Generate()
{
var rock = Rock.Create<IMessagePublishTopologyConfigurator>();
}
}
This is subtle, but...note that IMessagePublishTopologyConfigurator adds a setter for Exclude but also adds new. What Rocks ends up implementing is just the setter. VS and SharpLab says you should do it this way:
public class X
: IMessagePublishTopologyConfigurator
{
public bool Exclude { set => throw new NotImplementedException(); }
bool IMessagePublishTopology.Exclude => throw new NotImplementedException();
}
This was found with MassTransit.IMessagePublishTopologyConfigurator.
Here's the example:
This is subtle, but...note that
IMessagePublishTopologyConfiguratoradds a setter forExcludebut also addsnew. What Rocks ends up implementing is just the setter. VS and SharpLab says you should do it this way:This was found with
MassTransit.IMessagePublishTopologyConfigurator.