August 2013
Intermediate to advanced
340 pages
8h 43m
English
CHAPTER 3
![]()
Media-Type Formatting CLR Objects
From the ASP.NET Web API perspective, serialization is the process of translating a .NET Common Language Runtime (CLR) type into a format that can be transmitted over HTTP. The format is either JSON or XML, out of the box. A media type formatter, which is an object of type MediaTypeFormatter, performs the serialization in the ASP.NET Web API pipeline. Consider a simple action method handling GET in an ApiController:
public Employee Get(int id){ return list.First(e => e.Id == id);}
This method returns a CLR object of type Employee. In order for the data contained in this object to be returned ...