IBuildConfiguration IConfigureUpconverter.WithUpconverter(IUpconvertStoredItems upconverter) { this.EventUpconverter = upconverter ?? throw new ArgumentNullException(nameof(upconverter) , $"A non-null upconverter is required. Please use one of the extension methods to set them up. See {nameof(UpconverterExtensions.WithNoUpconverters)} or {nameof(UpconverterExtensions.WithUpconvertersFrom)}"); return(this); }
private KeyValuePair <Type, Func <ItemWithType, UpconvertResult> >[] GetUpconvertersFrom( IUpconvertStoredItems upconvertEngine) { var field = typeof(EventUpconverter) .GetField("upconverters", BindingFlags.Instance | BindingFlags.NonPublic); var upconverters = (IReadOnlyDictionary <Type, Func <ItemWithType, UpconvertResult> >)field.GetValue(upconvertEngine); return(upconverters.ToArray()); }
public IBuildConfiguration WithUpconverter(IUpconvertStoredItems upconverter) { this.upconverter = upconverter; return(this); }