System\Data\Services\DataService.cs (47)
232if (!WebUtil.IsCatchableExceptionType(handlingException))
353WebUtil.CheckArgumentNull(host, "host");
362WebUtil.CheckArgumentNull(messageBody, "messageBody");
458cachedConstructor = (Func<T>)WebUtil.CreateNewInstanceConstructor(dataContextType, null, dataContextType);
468WebUtil.CheckArgumentNull(args, "arg");
521if (!WebUtil.IsETagValueValid(host.RequestIfMatch, allowStrongEtag))
526if (!WebUtil.IsETagValueValid(host.RequestIfNoneMatch, allowStrongEtag))
711WebUtil.CheckVersion(dataService, description);
869etag = WebUtil.GetETagValue(dataService, actualEntity, container);
875WebUtil.WriteETagValueInResponseHeader(etag, host);
877return WebUtil.GetEmptyStreamWriter();
900IEnumerator queryResults = WebUtil.GetRequestEnumerator(description.RequestEnumerable);
926WebUtil.Dispose(queryResults);
994ContentFormat responseFormat = WebUtil.GetResponseFormatForPrimitiveValue(targetResourceType, out contentType);
1057if (!description.LinkUri && dataService.Provider.HasDerivedTypes(targetResourceType) && WebUtil.HasMediaLinkEntryInHierarchy(targetResourceType, dataService.Provider))
1362etagValue = WebUtil.CompareAndGetETag(resource, resource, container, dataService, out writeResponse);
1369WebUtil.Dispose(queryResults);
1375return WebUtil.GetEmptyStreamWriter();
1384WebUtil.Dispose(queryResults);
1389WebUtil.WriteETagValueInResponseHeader(etagValue, host);
1392return WebUtil.GetEmptyStreamWriter();
1401string etagValue = WebUtil.GetETagValue(dataService, actualEntity, container);
1408WebUtil.Dispose(queryResults);
1425WebUtil.CheckResourceExists(element != null, description.LastSegmentInfo.Identifier);
1426ResourceType resourceType = WebUtil.GetResourceType(dataService.Provider, element);
1519WebUtil.CheckResourceExists(resource != null, parentSegment.Identifier);
1530ResourceType openTypeParentResourceType = WebUtil.GetResourceType(dataService.Provider, resource);
1535resource = WebUtil.GetPropertyValue(dataService.Provider, resource, openTypeParentResourceType, resProperty, null);
1540resource = WebUtil.GetPropertyValue(dataService.Provider, resource, openTypeParentResourceType, null, currentSegment.Identifier);
1545resource = WebUtil.GetPropertyValue(dataService.Provider, resource, parentSegment.TargetResourceType, currentSegment.ProjectedProperty, null);
1568WebUtil.WriteETagValueInResponseHeader(etagValue, host);
1583WebUtil.Dispose(queryResults);
1661if (WebUtil.CompareMimeType(mime, XmlConstants.MimeApplicationJson))
1665else if (WebUtil.CompareMimeType(mime, XmlConstants.MimeApplicationAtom))
1672WebUtil.CompareMimeType(mime, XmlConstants.MimeApplicationXml) ||
1673WebUtil.CompareMimeType(mime, XmlConstants.MimeApplicationAtomService) ||
1674WebUtil.CompareMimeType(mime, XmlConstants.MimeTextXml),
1705if (!WebUtil.IsCatchableExceptionType(ex))
1751if (!WebUtil.IsCatchableExceptionType(exception))
1808return (description == null) ? WebUtil.GetEmptyStreamWriter() : SerializeResponseBody(description, this);
1826WebUtil.CheckVersion(this, null);
1904IDataServiceMetadataProvider metadataProviderInstance = WebUtil.GetService<IDataServiceMetadataProvider>(this);
1909queryProviderInstance = WebUtil.GetService<IDataServiceQueryProvider>(this);
2376if (!WebUtil.IsCatchableExceptionType(exception))
2539if (!WebUtil.IsCatchableExceptionType(exception))
2661Debug.Assert(WebUtil.IsCatchableExceptionType(exception), "WebUtil.IsCatchableExceptionType(exception)");
2857WebUtil.Dispose(this.query);
System\Data\Services\Parsing\RequestQueryParser.cs (38)
262throw ParseError(Strings.RequestQueryParser_ExpressionTypeMismatch(WebUtil.GetTypeName(typeof(bool)), exprPos));
279foreach (var v in WebUtil.Zip(topLevelOrderingInfo.OrderingExpressions, k.PositionalValues, (x, y) => new { Order = x, Value = y }))
363else if (WebUtil.IsNullConstant(expr))
847bool sourceNullable = WebUtil.IsNullableType(source);
848bool typeNullableA = WebUtil.IsNullableType(targetA);
849bool typeNullableB = WebUtil.IsNullableType(targetB);
1223return expression != WebUtil.NullLiteral && expression.Type == typeof(object) && IsOpenExpression(expression);
1338WebUtil.GetTypeName(left.Type),
1339WebUtil.GetTypeName(right.Type),
1353return WebUtil.NullLiteral;
1454if (WebUtil.TypeAllowsNull(left.Type))
1456if (!WebUtil.TypeAllowsNull(right.Type))
1461else if (WebUtil.TypeAllowsNull(right.Type))
1477if (left == WebUtil.NullLiteral)
1481else if (right == WebUtil.NullLiteral)
1496if (right == WebUtil.NullLiteral)
1500else if (left == WebUtil.NullLiteral)
1535if (WebUtil.IsNullConstant(left))
1539else if (WebUtil.IsNullConstant(right))
1557else if (left == WebUtil.NullLiteral || right == WebUtil.NullLiteral)
1567if (!WebUtil.TypeAllowsNull(left.Type))
1571else if (!WebUtil.TypeAllowsNull(right.Type))
1938if (!WebUtil.TypeAllowsNull(castTargetType))
1984WebUtil.TryResolveResourceType(this.provider, (string)((ConstantExpression)candidateTypeArgument).Value),
2045throw ParseError(Strings.RequestQueryParser_UnknownProperty(id, WebUtil.GetTypeName(type), errorPos));
2118throw ParseError(Strings.RequestQueryParser_UnknownProperty(id, WebUtil.GetTypeName(type), errorPos));
2272if (!this.nullPropagationRequired || element == this.it || !WebUtil.TypeAllowsNull(element.Type))
2279if (element is ConstantExpression && element != WebUtil.NullLiteral)
2288if (!WebUtil.TypeAllowsNull(falseIf.Type))
2310throw ParseError(Strings.RequestQueryParser_IncompatibleOperand(operationName, WebUtil.GetTypeName(args[0].Type), errorPos));
2420WebUtil.TypeAllowsNull(applicable[0].Parameters[0].ParameterType) ?
2478if (ce == WebUtil.NullLiteral)
2480if (WebUtil.TypeAllowsNull(type))
2496ResourceType resourceType = WebUtil.TryResolveResourceType(this.provider, text);
2553if (WebUtil.IsNullableType(expr.Type) && type.IsValueType)
2586WebUtil.RecurseEnterQueryParser(RecursionLimit, ref this.recursionDepth);
2592WebUtil.RecurseLeave(ref this.recursionDepth);
System\Data\Services\Providers\ResourceType.cs (15)
44WebUtil.PublicInstanceBindingFlags);
49WebUtil.PublicInstanceBindingFlags);
136WebUtil.CheckArgumentNull(instanceType, "instanceType");
137WebUtil.CheckStringArgumentNull(name, "name");
138WebUtil.CheckResourceTypeKind(resourceTypeKind, "resourceTypeKind");
161Debug.Assert(WebUtil.IsPrimitiveType(type), "This constructor should be called only for primitive types");
181WebUtil.CheckArgumentNull(type, "type");
182WebUtil.CheckArgumentNull(name, "name");
453WebUtil.CreateNewInstanceConstructor(this.InstanceType, this.FullName, typeof(object));
579WebUtil.CheckArgumentNull(type, "type");
581foreach (ResourceType resourceType in WebUtil.GetPrimitiveTypes())
598WebUtil.CheckArgumentNull(property, "property");
614WebUtil.CheckArgumentNull(attribute, "attribute");
793propertyType = WebUtil.TryResolveResourceType(deserializer.Service.Provider, foundTypeName);
1110BindingFlags bindingFlags = WebUtil.PublicInstanceBindingFlags;
System\Data\Services\Serializers\Deserializer.cs (13)
145ContentFormat requestFormat = WebUtil.SelectRequestFormat(mimeType, description);
254requestFormat = WebUtil.GetResponseFormatForPrimitiveValue(description.TargetResourceType, out contentType);
255if (!WebUtil.CompareMimeType(contentType, mimeType))
312requestFormat = WebUtil.SelectRequestFormat(mimeType, description);
613WebUtil.CopyStream(requestStream, writeStream, service.StreamProvider.StreamBufferSize);
895WebUtil.RecurseEnter(RecursionLimit, ref this.recursionDepth);
901WebUtil.RecurseLeave(ref this.recursionDepth);
923WebUtil.CheckResourceExists(resourceCookie != null, requestDescription.LastSegmentInfo.Identifier);
977WebUtil.CheckResourceExists(resourceCookie != null, segmentInfo.Identifier);
1029if (WebUtil.IsAtomMimeType(this.Service.OperationContext.Host.RequestAccept))
1036WebUtil.CheckVersion(this.Service, this.RequestDescription);
1099if (requestValue == null || WebUtil.IsPrimitiveType(requestValue.GetType()))
1105if (WebUtil.GetNonPrimitiveResourceType(provider, requestValue).ResourceTypeKind == ResourceTypeKind.ComplexType)
System\Data\Services\Serializers\Serializer.cs (7)
263return WebUtil.GetPropertyValue(provider, customObject, null, property, null);
559WebUtil.RecurseEnter(RecursionLimit, ref this.recursionDepth);
565WebUtil.RecurseLeave(ref this.recursionDepth);
720return WebUtil.GetETagValue(this.service, resource, this.CurrentContainer);
738ResourceType resourceType = WebUtil.GetNonPrimitiveResourceType(provider, resource);
747object keyValue = WebUtil.GetPropertyValue(provider, resource, resourceType, property, null);
1239object value = WebUtil.GetPropertyValue(this.provider, this.element, null, property, null);
System\Data\Services\Serializers\SyndicationSerializer.cs (11)
188resourcePropertyType = (element == null) ? ResourceType.PrimitiveStringResourceType : WebUtil.GetResourceType(this.Provider, element);
426ResourceType resourceType = WebUtil.GetNonPrimitiveResourceType(this.Provider, element);
494ResourceType actualResourceType = WebUtil.GetNonPrimitiveResourceType(this.Provider, element);
683WebUtil.Dispose(elements);
828object propertyValue = WebUtil.GetPropertyValue(this.Provider, customObject, resourceType, property, null);
853object propertyValue = WebUtil.GetPropertyValue(this.Provider, customObject, resourceType, property, null);
892propertyResourceType = WebUtil.GetResourceType(this.Provider, value);
964object propertyValue = WebUtil.GetPropertyValue(this.Provider, customObject, resourceType, property, property == null ? propertyName : null);
980propertyResourceType = WebUtil.GetResourceType(this.Provider, propertyValue);
1089bool collection = WebUtil.IsElementIEnumerable(expandedPropertyValue, out enumerable);
1112WebUtil.Dispose(enumerator);
System\Data\Services\WebUtil.cs (17)
47internal static readonly MethodInfo GetNamedPropertyValueMethodInfo = typeof(WebUtil).GetMethod(
435if (WebUtil.CompareMimeType(contentType, XmlConstants.MimeApplicationJson))
439else if (WebUtil.CompareMimeType(contentType, XmlConstants.MimeTextXml) ||
440WebUtil.CompareMimeType(contentType, XmlConstants.MimeApplicationXml))
444else if (WebUtil.CompareMimeType(contentType, XmlConstants.MimeApplicationAtom) ||
445WebUtil.CompareMimeType(contentType, XmlConstants.MimeAny))
634ResourceType[] types = WebUtil.GetPrimitiveTypes();
918keyValue = WebUtil.GetPropertyValue(service.Provider, resource, resourceType, property, null);
959ResourceType resourceType = WebUtil.GetNonPrimitiveResourceType(service.Provider, resource);
963return WebUtil.GetETagValue(resource, resourceType, etagProperties, service, true /*getMethod*/);
1070ResourceType resourceType = WebUtil.GetNonPrimitiveResourceType(service.Provider, parentEntityResource);
1096etag = WebUtil.GetETagValue(parentEntityToken, resourceType, etagProperties, service, true /*getMethod*/);
1113etag = WebUtil.GetETagValue(parentEntityResource, resourceType, etagProperties, service, true /*getMethod*/);
1187if (WebUtil.IsWhitespace(reader.Value))
1336return WebUtil.GenericExpandedWrapperTypes.Single(x => x.Index == wrapperParameters.Length - 1).Type.MakeGenericType(wrapperParameters);
1346return inputType.IsGenericType && WebUtil.GenericExpandedWrapperTypes.SingleOrDefault(x => x.Type == inputType.GetGenericTypeDefinition()) != null;
1610return WebUtil.CompareMimeType(mime, XmlConstants.MimeApplicationAtom);