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