title: How can we have Middleware like architecture in ASP.NET Core for our application?
body: <p>I want to know how can I have middleware architecture like asp.net core in my application ? </p>
  
  <p>Which pattern needs for this goal ? </p>
  
  <p>Is there any reference for designing like this for adding new features and ... ?</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      loggerFactory.AddConsole(Configuration.GetSection("Logging"));
      loggerFactory.AddDebug();
  
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
          app.UseDatabaseErrorPage();
          app.UseBrowserLink();
      }
      else
      {
          app.UseExceptionHandler("/Home/Error");
      }
  
      app.UseStaticFiles();
  
      app.UseIdentity();
  
      // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715
  
      app.UseMvc(routes =&gt;
      {
          routes.MapRoute(
              name: "default",
              template: "{controller=Home}/{action=Index}/{id?}");
      });
  }
  </code></pre>
  
  <p>With very simple Configure method we can add new features to application How they implement something like this ?</p>