public ServiceUnitRequestMiddleware(AppFunc next, ServiceUnitSettings settings)
 {
     this.next     = next;
     this.settings = settings ?? ServiceUnitSettings.Create();
 }
 public static IAppBuilder UseServiceUnit(this IAppBuilder builder, ServiceUnitSettings settings, params IMiddlewareRegisterSetting[] middlewares)
 {
     //service unit request context の生成と保持
     builder = builder.Use<ServiceUnitRequestMiddleware>(settings);
     return ApplyMiddlewares(builder, middlewares);
 }
 private ServiceUnitSettings(ServiceUnitSettings source)
 {
     this.ContextCreatedHandler = source.ContextCreatedHandler;
 }
 public static IAppBuilder UseServiceUnit(this IAppBuilder builder, params IMiddlewareRegisterSetting[] middlewares)
 {
     //service unit request context の生成と保持
     return builder.UseServiceUnit(ServiceUnitSettings.Create(), middlewares);
 }