@manhnguyenv

Welcome to my blog!

Web API AND XML

March 15, 2018 21:27

Code

Ví dụ

http://www.lateral8.com/articles/2010/3/5/openxml-sdk-20-export-a-datatable-to-excel.aspx

<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccountProblem</Code>
<Message>Your Google account is not currently enabled for this operation. Please check https://console.developers.google.com/billing to see if you have a past due balance or if the credit card (or other payment mechanism) on your account is expired. You can find additional information at https://developers.google.com/storage/docs/signup</Message>
<Details>The billing account for the requested project is disabled in state 'closed'</Details>
</Error>

JSON

November 7, 2017 10:09

camelCase JSON Serialized

Install-Package Newtonsoft.Json

Convert object to JSON with camelCase format

var jsonSerializerSettings = new JsonSerializerSettings
{
       ContractResolver = new CamelCasePropertyNamesContractResolver()
};
var json = JsonConvert.SerializeObject(obj, jsonSerializerSettings);

 

Refer:

https://codehollow.com/2017/05/return-json-from-csharp-azure-function/

https://stackoverflow.com/questions/19445730/how-can-i-return-camelcase-json-serialized-by-json-net-from-asp-net-mvc-controll

Categories