You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
791 B
24 lines
791 B
Imports System.Net.Http.Formatting
|
|
Imports Newtonsoft.Json
|
|
Imports Newtonsoft.Json.Serialization
|
|
'Imports WebApiContrib.Formatting.Jsonp
|
|
|
|
Public Class FormatterConfig
|
|
|
|
Public Shared Sub RegisterFormatters(formatters As MediaTypeFormatterCollection)
|
|
|
|
'>>> WebApiContrib.Formatting.Jsonp
|
|
'>>> STACKOVERFLOW-EXCEPTION: https://github.com/WebApiContrib/WebApiContrib.Formatting.Jsonp/pull/10
|
|
|
|
'Dim jsonFormatter = formatters.JsonFormatter
|
|
|
|
'jsonFormatter.SerializerSettings = New JsonSerializerSettings() With {
|
|
' .ContractResolver = New CamelCasePropertyNamesContractResolver()
|
|
'}
|
|
|
|
'Dim jsonpFormatter = New JsonpMediaTypeFormatter(formatters.JsonFormatter)
|
|
'formatters.Insert(0, jsonpFormatter)
|
|
|
|
End Sub
|
|
|
|
End Class
|
|
|