<pre><code class="language-csharp">
public interface IDummyFactory
{
 // This method will return the names of all registered implementations of TService.
 IList<string> GetNames<TService>();

 // This method will just create the default IDummyService implementation.
 IDummyService CreateDummyService();

 // This method will just create the default IDummyService implementation and pass namePart1 and namePart2 as
 // dependencies.
 IDummyService CreateDummyService(string namePart1, string namePart2);

 // This method will create IDummyService implementation with serviceName name.
 IDummyService GetNamedDummyService(string serviceName, string namePart1, string namePart2);

 // Generic methods are also allowed as factory methods.
 TService CreateService<TService>();

 // Something that is common for event-sourcing implementations.
 IHandler<TMessage> CreateHandler<TMessage>();
}

</code></pre>
0 commit comments