Example #1
0
 public AresFormsMiddleware(RequestDelegate next, IFormRepository formRepository, IVisitor visitor, IOptions <AresFormsOptions> options)
 {
     this.formRepository = formRepository;
     this.visitor        = visitor;
     this.next           = next;
     this.options        = options.Value;
 }
Example #2
0
        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)));
        }