- Dev Blogs
- .NET Blog
No trial. No credit card required. Just your GitHub account.
.NET Blog
Free. Cross-platform. Open source. A developer platform for building all your apps.
Featured posts

Announcing .NET 9

Announcing the release of .NET 9, the most productive, modern, secure, intelligent, and performant release of .NET yet. With updates across ASP.NET Core, C#, .N...
Latest posts

Translating OData queries to HQL
AspNet Web API OData makes it really simple to expose your IQueryable backend to be queried using the OData query syntax. Check out some samples here. If you are building using Entity Framework as your ORM (object-relational mapping) to talk to your database or just store all your data in-memory(Linq2Objects), you are in a good shape as you have an existing IQueryable. If you are talking to your own custom data source, you might not be lucky enough to have a LINQ provider or have a provider that has an incomplete implementation. If you are in this mess and are about to undertake the herculean task of implementing...

MVC Single Page Application Template for ASP.NET and Web Tools 2012.2
With the final release of ASP.NET and Web Tools 2012.2, we refreshed single page application page on asp.net . It talks about KnockoutJS Template and introduced 4 community created SPA templates that you can install as MVC templates. There are four improvements for the MVC SPA template RTM release over the RC release that worth a note. Antiforgery support for Web API calls The ValidateAntiForgeryToken filter only works on MVC calls. Web API doesn't have a default Antiforgery filter yet. We implemented attribute “ValidateHttpAntiForgeryToken” inside Filters\ValidateHttpAntiForgeryTokenAttribute.cs to supp...

Pre-release of ASP.NET Scaffolding with a Web Forms scaffold generator
Today we are sharing a pre-release build of a new code generation framework known as ASP.NET Scaffolding, as well as a scaffold generator (code generator) for Web Forms. The Web Forms scaffold generator can automatically build Create-Read-Update-Delete (CRUD) views based on a model. Introduction Many programming tasks involve writing standard “boilerplate” code. Templates can help avoid having to hand-write all of this code, but only to a degree because they are static. MVC3 introduced the concept of scaffolding - generating code dynamically based on existing artifacts in a project. We are now extending this co...

A Message Flow in ASP.NET Web API OData
One of the biggest benefits that you have with ASP.NET Web API is that it gives 100% transparency of the source code because it is open source. You can easily enlist in the code repository and add the symbol path based on instructions at the CodePlex site, then off you go, you can debug the Web API code as if you were the original code author. Now if you are like me, who like to put a few breakpoints in the source code before hitting F5, you will need to understand the OData stack a little better. If everything goes expected, you might not need those breakpoints. But if anything goes wrong, such as getting a 500...

.NET Framework Documentation Improvements
The CLR documentation team has been busy responding to feedback and making updates and changes to the .NET Framework documentation in the MSDN Library. We would like to tell you about the most recent set of document updates, which were published earlier in February. Performance content We have received extensive customer feedback regarding the importance of performance in .NET Framework apps, and we wanted to make it easier for you to find relevant content. As a result, we’ve reworked the existing performance and reliability topic to include more performance guidance as well as links to performance analysis t...

Getting a MIME type from a file extension in ASP.NET 4.5
If you've ever implemented a file upload or download scenario in ASP.NET, you've likely come across the situation of having to provide a MIME type based off of a file extension. IIS does this automatically when it serves files, but it seems like in ASP.NET there isn't a good way to provide this functionality. Searches on the web might point you to building your own Dictionary of MIME types or just writing a switch statement, but this felt like a hack to me and so I turned to a resident expert, Levi Broderick.It turns out in ASP.NET 4.5 we shipped a little-known new type, System.Web.MimeMapping, which has an API c...

Protect your Queryable API with the validation feature in ASP.NET Web API OData
In the previous blog post, you can see how easy it is to enable OData query syntax for a particular action using Web API OData. Simply add a Queryable attribute to your action as follows, and you are done. It not only works for those actions using OData format, but also applies to any vanilla web api actions using other formats such as JSON.NET. It greatly reduces the need to write a lot of actions to perform operations like top, skip, orderby as well as filter. It is so powerful that it is almost hard to imagine building a real Web API application without it. Now everything works beautifull...

Getting started with ASP.NET Web API OData in 3 simple steps
With the upcoming ASP.NET 2012.2 release, we’ll be adding support for OData to Web API. In this blog post, I’ll go over the three simple steps you’ll need to go through to get your first OData service up and running: Before we dive in, the code snippets in this post won’t work if you’re using the RC build. You can upgrade to using our latest nightly build by taking a look at this helpful blog post. 1) Creating your EDM model First, we’ll create an EDM model to represent the data model we want to expose to the world. The ODataConventionModelBuilder class makes this this easy by using a set of conv...

ASP.NET MVC, Data Access, and Deployment Content Maps Published
We are pleased to announce the publication on the ASP.NET site of three guides to ASP.NET documentation resources: The content maps provide links to good quality up-to-date tutorials, articles, blogs, videos, and forum and StackOverflow threads. The guides exist on MSDN, but we’re publishing updated versions on the ASP.NET site now in hopes that they’ll get more use and generate more feedback. With your help, we hope to update them every 4-6 weeks with the latest and best links. The top of each page includes an invitation to email us with suggestions: If you know a great blog post,...