public static IInvokerConfigElement <object> Invokes <TTarget>(this IInvokerConfigElement <object> invokerConfiguration, string name = null) where TTarget : class { var child = new InvokerElement <TTarget>(name ?? typeof(TTarget).Name, parent: invokerConfiguration); if (invokerConfiguration.Children == null) { invokerConfiguration.Children = new IInvokerConfigElement <object>[] { }; } invokerConfiguration.Children = invokerConfiguration.Children.Append(child).ToArray(); return(child); }
public static IInvokerConfigElement <object> InvokesMultiple(this IInvokerConfigElement <object> invokerConfiguration, params IInvokerConfigElement <object>[] children) { var parentList = children.Select(leaf => { var parent = leaf.Clone() as IInvokerConfigElement <object>; while (parent.Parent != null) { parent = parent.Parent; } return(parent); }).ToList(); invokerConfiguration.Children = parentList.ToArray(); parentList.ForEach(child => child.Parent = invokerConfiguration); return(invokerConfiguration); }
public InvokerElement(string name = null, IInvokerConfigElement <object> parent = null, params IInvokerConfigElement <object>[] children) : this(name) { this.Parent = parent; this.Children = children; }
public static IContainer RegisterInvoker <TRequest, TResponse>(this IContainer container, IInvokerConfigElement <object> invokerConfiguration) { return(RegisterInvoker <TRequest, TResponse>(container, null, invokerConfiguration)); }
public static IContainer RegisterInvoker <TRequest>(this IContainer container, string name, IInvokerConfigElement <object> invokerConfiguration) { var stack = RegisterDependencies(container, name, invokerConfiguration); return(RegisterInvoker <TRequest>(container, name, stack)); }