Sitecore Swamp

Dive in the Sitecore Swamp

NAVIGATION - SEARCH

New language features in C# 6

Before looking into the new in C# 6, let look back the history of the C# language:

RestSharp - a smarter RESTful service client

var request = new RestRequest("ShoppingBasket") { Method = Method.POSTRequestFormat = DataFormat.Json};
request.AddBody(basketLineItem);
var response = _client.Execute(request);
POST /api/ShoppingBasket HTTP/1.1
Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml
User-Agent: RestSharp/104.4.0.0
Content-Type: application/json
Host: 101.2.171.213:8100
Content-Length: 80
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

{"CustomerId":"123456","ProductId":0,"ProductName":0,"Quantity":0,"UnitPrice":0}