public AresFormsMiddleware(RequestDelegate next, IFormRepository formRepository, IVisitor visitor, IOptions <AresFormsOptions> options) { this.formRepository = formRepository; this.visitor = visitor; this.next = next; this.options = options.Value; }
public static IApplicationBuilder UseAresForms(this IApplicationBuilder app, AresFormsOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <AresFormsMiddleware>(Options.Create(options))); }