{"action":"opened","issue":{"url":"https://api.github.com/repos/jbogard/MediatR/issues/172","repository_url":"https://api.github.com/repos/jbogard/MediatR","labels_url":"https://api.github.com/repos/jbogard/MediatR/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/jbogard/MediatR/issues/172/comments","events_url":"https://api.github.com/repos/jbogard/MediatR/issues/172/events","html_url":"https://github.com/jbogard/MediatR/issues/172","id":230015717,"number":172,"title":"Registering pipeline behaviors problem","user":{"login":"jsodeman","id":2388842,"avatar_url":"https://avatars2.githubusercontent.com/u/2388842?v=3","gravatar_id":"","url":"https://api.github.com/users/jsodeman","html_url":"https://github.com/jsodeman","followers_url":"https://api.github.com/users/jsodeman/followers","following_url":"https://api.github.com/users/jsodeman/following{/other_user}","gists_url":"https://api.github.com/users/jsodeman/gists{/gist_id}","starred_url":"https://api.github.com/users/jsodeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsodeman/subscriptions","organizations_url":"https://api.github.com/users/jsodeman/orgs","repos_url":"https://api.github.com/users/jsodeman/repos","events_url":"https://api.github.com/users/jsodeman/events{/privacy}","received_events_url":"https://api.github.com/users/jsodeman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-19T15:50:45Z","updated_at":"2017-05-19T15:50:45Z","closed_at":null,"body":"\r\nI'm struggling to get a validation pipeline working, I think I'm close but I'm getting the following back from Simple Injector. I'm using the latest versions of Mediatr, FluentValidation, and Simple Injector.\r\n\r\n`No registration for type IEnumerable<IPipelineBehavior<MyRequest, MyResponse>> could be found.`\r\n\r\nI've registered the pipeline using\r\n\r\n`container.Register(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));`\r\n\r\nand the docs say \r\n\r\n> MediatR uses the MultiInstanceFactory delegate to resolve the IEnumerable<IPipelineBehavior<TRequest, TResponse>> for whatever closed types your request and responses are.\r\n\r\nThe full set of related registrations is\r\n\r\n```\r\nvar assemblies = GetAssemblies().ToArray();\r\ncontainer.RegisterSingleton<IMediator, Mediator>();\r\ncontainer.Register(typeof(IRequestHandler<,>), assemblies);\r\ncontainer.Register(typeof(IAsyncRequestHandler<,>), assemblies);\r\ncontainer.Register(typeof(IRequestHandler<>), assemblies);\r\ncontainer.Register(typeof(IAsyncRequestHandler<>), assemblies);\r\ncontainer.Register(typeof(ICancellableAsyncRequestHandler<>), assemblies);\r\ncontainer.RegisterCollection(typeof(INotificationHandler<>), assemblies);\r\ncontainer.RegisterCollection(typeof(IAsyncNotificationHandler<>), assemblies);\r\ncontainer.RegisterCollection(typeof(ICancellableAsyncNotificationHandler<>), assemblies);\r\n\r\ncontainer.RegisterSingleton(new SingleInstanceFactory(container.GetInstance));\r\ncontainer.RegisterSingleton(new MultiInstanceFactory(container.GetAllInstances));\r\n\r\ncontainer.Register(typeof(IValidator<>), assemblies);\r\ncontainer.RegisterConditional(typeof(IValidator<>), typeof(ValidateNothingDecorator<>), context => !context.Handled);\r\ncontainer.Register(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));\r\n```\r\n\r\n"}}
{"actor":{"display_login":"jsodeman"}}