Posted by Anuraj on Thursday, July 23, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC Visual Studio Web API
This post is about building another middleware component for ASP.NET 5. Long back I wrote a post about Basic authentication for Web API. This implementation uses the same functionality. It checks for Authorization header in the HTTP Request, if not found it set the Response status code to 401 and adds a WWW-Authenticate header. When browser receives such response, it will show the Basic authentication dialog. If the header is set, you can parse the header and validate the credentials against database. Here is the implementation.
Posted by Anuraj on Tuesday, July 14, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC Unit Testing
This post is about unit testing your middleware components. For testing middleware ASP.NET team introduced a TestHost package, this package contains a TestServer which can create an ASP.NET request processing pipeline and helpers to submit requests to the pipeline as if it is a real server. Requests made with these helpers never hit the network as they are processed directly in memory. . You can verify the content type, http status code etc. To write unit test, you require “Microsoft.AspNet.TestHost” package and dnx supported XUnit packages as well.
Posted by Anuraj on Monday, July 13, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC Visual Studio
Posted by Anuraj on Wednesday, July 8, 2015 Reading time :1 minute
.Net .Net 3.0 / 3.5 ASP.Net ASP.Net MVC
This post is about developing your own ASP.NET 5 middleware. What is Middleware - The definition of “Middleware” varies depends on its context, but in ASP.NET 5, the definition provided by the OWIN specification is probably closest - Pass through components that form a pipeline between a server and application to inspect, route, or modify request and response messages for a specific purpose. Middleware components are similar to ASP.NET HttpModules and/or HttpHandlers. You can access the ASP.NET request pipeline via Startup.cs class, Configure() method. Configure method helps developers to plugin middleware components. Here is the Startup.cs from HelloMVC sample project
Posted by Anuraj on Tuesday, July 7, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC
ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. Sessions values can be stored for the duration of the visitor’s session on your site. Most cases, they are stored in server memory. You can configure session to store either in State server or in SQL Server. In ASP.NET MVC, you can create and access session variables using HttpContext.Current.Session. In ASP.NET 5, ASP.NET team implemented a middleware to support session management.
Posted by Anuraj on Monday, July 6, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC ASP.NET Core
In ASP.NET 5 MVC 6 Microsoft changed the File upload feature. Now MVC 6 support model binding of multipart form data, which means, you can include file as the property of your model.
Posted by Anuraj on Sunday, July 5, 2015 Reading time :1 minute
.Net ASP.Net ASP.Net MVC Version Control
Few days back I did a post on Continuous Integration with ASP.NET 5, GitHub and Travis CI. In that post I was using K runtime and K commands. From ASP.NET 5 Beta 4, Microsoft changed the runtime to DNX, the K runtime became obsolete. This post is about continuous integration using DNX runtime. Only minor changes are required. Here is the .travis.yml file.