public override void Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) { if (operation == null) throw new ArgumentNullException("operation"); var maybeConfigCreator = TryGetConfigCreator(operation); if (maybeConfigCreator != null) { //Configure will have been called with the "real" ConfigurationElement from the ChannelConfiguration.config. //We "re-Configure" if this key is present in the operation.Model. if(_realConfiguration == null) throw new InvalidOperationException("Configure should have been called before an Execute."); base.Configure(maybeConfigCreator.Create(_realConfiguration)); } base.Execute(operation, operationCache, response); }
protected virtual ICreateOrderPipelinesConfig TryGetConfigCreator(CommerceOperation commerceOperation) { return commerceOperation.Model.GetPropertyValue(ModelKey) as ICreateOrderPipelinesConfig; }