mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Wrokaround issue with current autofac integration
--HG-- branch : dev
This commit is contained in:
@@ -15,10 +15,13 @@ namespace Orchard.Commands {
|
|||||||
public void Execute(CommandParameters parameters) {
|
public void Execute(CommandParameters parameters) {
|
||||||
var matches = _handlers.SelectMany(h => MatchCommands(parameters, GetDescriptor(h.Metadata), h.Value));
|
var matches = _handlers.SelectMany(h => MatchCommands(parameters, GetDescriptor(h.Metadata), h.Value));
|
||||||
|
|
||||||
if (matches.Count() == 1) {
|
|
||||||
var match = matches.Single();
|
// Workaround autofac integration: module registration is currently run twice...
|
||||||
|
//if (matches.Count() == 1) {
|
||||||
|
// var match = matches.Single();
|
||||||
|
if (matches.Count() == 2) {
|
||||||
|
var match = matches.First();
|
||||||
match.CommandHandlerFactory().Execute(match.Context);
|
match.CommandHandlerFactory().Execute(match.Context);
|
||||||
parameters.Output = match.Context.Output;
|
|
||||||
}
|
}
|
||||||
else if (matches.Any()) {
|
else if (matches.Any()) {
|
||||||
// too many
|
// too many
|
||||||
@@ -56,7 +59,6 @@ namespace Orchard.Commands {
|
|||||||
},
|
},
|
||||||
CommandHandlerFactory = handlerFactory
|
CommandHandlerFactory = handlerFactory
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user