88 references to ContentFormat
System.Data.Services (88)
System\Data\Services\DataService.cs (31)
590
private static Encoding GetRequestAcceptEncoding(
ContentFormat
responseFormat, string acceptCharset)
592
if (responseFormat ==
ContentFormat
.Binary)
610
private static
ContentFormat
SelectResponseFormat(DataServiceHostWrapper host, string acceptTypesText, bool entityTarget)
636
return
ContentFormat
.Unsupported;
882
ContentFormat
responseFormat = SelectResponseFormatForType(
915
if (responseFormat ==
ContentFormat
.Unknown)
920
Debug.Assert(responseFormat !=
ContentFormat
.Unknown, "responseFormat != ContentFormat.Unknown");
945
private static
ContentFormat
SelectResponseFormatForType(
952
ContentFormat
responseFormat;
961
responseFormat =
ContentFormat
.Unknown;
967
if (responseFormat ==
ContentFormat
.Unsupported)
975
responseFormat =
ContentFormat
.Unknown;
987
private static
ContentFormat
SelectPrimitiveContentType(ResourceType targetResourceType, string acceptTypesText, string requiredContentType, DataServiceHostWrapper host)
994
ContentFormat
responseFormat = WebUtil.GetResponseFormatForPrimitiveValue(targetResourceType, out contentType);
1008
private static
ContentFormat
SelectMediaResourceContentType(object mediaLinkEntry, string acceptTypesText, IDataService service)
1020
return
ContentFormat
.Binary;
1225
Deserializer.ModifyResource(description, resource, null,
ContentFormat
.Text, dataService);
1249
Deserializer.ModifyResource(description, resource, null,
ContentFormat
.Text, dataService);
1270
ContentFormat
format =
ContentFormat
.Unknown;
1277
format =
ContentFormat
.MetadataDocument;
1296
format !=
ContentFormat
.Unknown,
1321
ContentFormat
responseFormat,
1418
private static
ContentFormat
ResolveUnknownFormat(RequestDescription description, object element, IDataService dataService)
1498
ContentFormat
responseFormat,
1556
if (responseFormat ==
ContentFormat
.Unknown)
1561
Debug.Assert(responseFormat !=
ContentFormat
.Unknown, "responseFormat != ContentFormat.Unknown");
1659
private static
ContentFormat
GetContentFormat(string mime)
1663
return
ContentFormat
.Json;
1667
return
ContentFormat
.Atom;
1676
return
ContentFormat
.PlainXml;
System\Data\Services\ResponseBodyWriter.cs (13)
44
private readonly
ContentFormat
responseFormat;
62
ContentFormat
responseFormat)
64
Debug.Assert(responseFormat !=
ContentFormat
.Unknown, "responseFormat != ContentFormat.Unknown");
108
case
ContentFormat
.Binary:
130
case
ContentFormat
.Text:
141
case
ContentFormat
.Atom:
142
case
ContentFormat
.Json:
143
case
ContentFormat
.PlainXml:
150
if (this.responseFormat ==
ContentFormat
.Json)
167
if (
ContentFormat
.Json == this.responseFormat)
171
else if (
ContentFormat
.PlainXml == this.responseFormat)
200
this.responseFormat ==
ContentFormat
.MetadataDocument,
217
string contentType = (this.responseFormat ==
ContentFormat
.Json) ? XmlConstants.MimeApplicationJson : XmlConstants.MimeApplicationXml;
System\Data\Services\Serializers\Deserializer.cs (17)
82
protected abstract
ContentFormat
ContentFormat
145
ContentFormat
requestFormat = WebUtil.SelectRequestFormat(mimeType, description);
158
case
ContentFormat
.Json:
166
case
ContentFormat
.Atom:
176
case
ContentFormat
.PlainXml:
201
internal static object ConvertValues(object value, ResourceProperty property,
ContentFormat
contentFormat, DataServiceProviderWrapper provider)
205
if (contentFormat ==
ContentFormat
.Json)
209
else if (contentFormat ==
ContentFormat
.Atom || contentFormat ==
ContentFormat
.PlainXml)
216
contentFormat ==
ContentFormat
.Binary || contentFormat ==
ContentFormat
.Text,
237
ContentFormat
requestFormat;
267
if (requestFormat ==
ContentFormat
.Binary)
281
Debug.Assert(requestFormat ==
ContentFormat
.Text, "requestFormat == ContentFormat.Text");
307
requestFormat =
ContentFormat
.Binary;
504
internal static void ModifyResource(RequestDescription description, object resourceToBeModified, object requestValue,
ContentFormat
contentFormat, IDataService service)
783
protected static void SetPropertyValue(ResourceProperty resourceProperty, object declaringResource, object propertyValue,
ContentFormat
contentFormat, IDataService service)
System\Data\Services\Serializers\JsonDeserializer.cs (4)
58
protected override
ContentFormat
ContentFormat
62
return
ContentFormat
.Json;
562
SetPropertyValue(resourceProperty, resource, propertyValue,
ContentFormat
.Json, this.Service);
570
SetPropertyValue(resourceProperty, resource, propertyValue,
ContentFormat
.Json, this.Service);
System\Data\Services\Serializers\PlainXmlDeserializer.cs (2)
69
protected override
ContentFormat
ContentFormat
73
return
ContentFormat
.PlainXml;
System\Data\Services\Serializers\SyndicationDeserializer.cs (2)
72
protected override
ContentFormat
ContentFormat
76
return
ContentFormat
.Atom;
System\Data\Services\WebUtil.cs (19)
108
private static readonly KeyValuePair<Type,
ContentFormat
>[] PrimitiveTypesContentFormatMapping =
109
new KeyValuePair<Type,
ContentFormat
>[]
111
new KeyValuePair<Type,
ContentFormat
>(typeof(byte[]),
ContentFormat
.Binary),
112
new KeyValuePair<Type,
ContentFormat
>(typeof(Binary),
ContentFormat
.Binary),
334
internal static
ContentFormat
GetResponseFormatForPrimitiveValue(ResourceType valueType, out string contentType)
336
ContentFormat
result =
ContentFormat
.Text;
351
foreach (KeyValuePair<Type,
ContentFormat
> mapping in PrimitiveTypesContentFormatMapping)
431
internal static
ContentFormat
SelectRequestFormat(string contentType, RequestDescription description)
433
ContentFormat
contentFormat;
437
contentFormat =
ContentFormat
.Json;
442
contentFormat =
ContentFormat
.PlainXml;
447
contentFormat =
ContentFormat
.Atom;
451
return
ContentFormat
.Unsupported;
456
if (contentFormat ==
ContentFormat
.Atom)
468
if (contentFormat ==
ContentFormat
.PlainXml)
477
contentFormat ==
ContentFormat
.Atom)