Exemplo n.º 1
0
        internal static void ValidateServiceDocumentElement(ODataServiceDocumentElement serviceDocumentElement, ODataFormat format)
        {
            if (serviceDocumentElement == null)
            {
                throw new ODataException(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem);
            }

            // The resource collection URL must not be null;
            if (serviceDocumentElement.Url == null)
            {
                throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyUrl);
            }

            if (format == ODataFormat.Json && string.IsNullOrEmpty(serviceDocumentElement.Name))
            {
                throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyName(serviceDocumentElement.Url.ToString()));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Validates a element in service document.
 /// </summary>
 /// <param name="serviceDocumentElement">The element in service document to validate.</param>
 /// <param name="format">Format that is being validated.</param>
 public void ValidateServiceDocumentElement(ODataServiceDocumentElement serviceDocumentElement, ODataFormat format)
 {
 }
 /// <summary>
 /// Validates a element in service document.
 /// </summary>
 /// <param name="serviceDocumentElement">The element in service document to validate.</param>
 /// <param name="format">Format that is being validated.</param>
 public void ValidateServiceDocumentElement(ODataServiceDocumentElement serviceDocumentElement, ODataFormat format)
 {
 }
Exemplo n.º 4
0
        internal static void ValidateServiceDocumentElement(ODataServiceDocumentElement serviceDocumentElement, ODataFormat format)
        {
            if (serviceDocumentElement == null)
            {
                throw new ODataException(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem);
            }

            // The resource collection URL must not be null; 
            if (serviceDocumentElement.Url == null)
            {
                throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyUrl);
            }

            if (format == ODataFormat.Json && string.IsNullOrEmpty(serviceDocumentElement.Name))
            {
                throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyName(serviceDocumentElement.Url.ToString()));
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Validates a element in service document.
 /// </summary>
 /// <param name="serviceDocumentElement">The element in service document to validate.</param>
 /// <param name="format">Format that is being validated.</param>
 public void ValidateServiceDocumentElement(ODataServiceDocumentElement serviceDocumentElement, ODataFormat format)
 {
     ValidationUtils.ValidateServiceDocumentElement(serviceDocumentElement, format);
 }