/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="namedArguments">The named arguments that are injected into the resolved type.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part, AnonymousArgument namedArguments) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>(namedArguments))); }
/// <summary> /// Resolve an object and inject the given arguments into it. /// </summary> /// <typeparam name="TContract">The type of the contract.</typeparam> /// <param name="namedArguments">The named constructor arguments.</param> /// <returns>The resolved instance as TContract.</returns> public TContract Resolve <TContract>(AnonymousArgument namedArguments) { return(RootContainer.Resolve <TContract>(namedArguments)); }