public object create(Type type) { ICanCreate creator = this.creators[type]; return(creator.create()); }
public void registerCreator(Type type, ICanCreate creator, bool replace) { registerCreator(type, creator, replace); }
public static IServiceBus Create(this ICanCreate <IMessage, ICommand, IEvent, IRequest, IResponse> creator) { return(new ServiceBus(creator.CreateServiceBus())); }
public void registerCreator(Type type, ICanCreate creator) { this.factory.registerCreator(type, creator); }
public void RegisterCreator <T>(ICanCreate <T> creator) where T : class { mappings[typeof(T)] = creator; }
public T Create <T>() { ICanCreate <object> creator = mappings[typeof(T)]; return((T)creator.NewObject()); // I do not think you can get rid of this cast }