From my exploration of this issue, I can see how one would want to have BuildFunc = Action<Func<IDictionary<string,object>, MidFunc>>
That would let you write:
public static BuildFunc MyStuff(this BuildFunc builder) {
builder(properties => new MyMiddleware(properties).Invoke);
}
There is an additional advantage to this signature, it allows you to delay the actual initialization (and loading of the server property bag) until you are happy that you have collected all needed information about how to wire things up.
This would allow me to reintroduce the automatic http pipeline reordering that I need for the OR-compatible builder. It would also allow a back channel for middlewares to report information about themselves (with a special set of keys “owin.currentMiddleware.*”)
which the builder can swap in and out as it gets called, potentially helping the glimpse guys by providing diagnostic keys.
Any other alternatives out there? I’d like to propose some text for BuildFunc today to start getting the ball rolling. It would be nice if everyone could share with us the things they use (and intend to use) the .Porperties on IAppBuilder for, what the
design decisions have been and what must exist.