Esempio n. 1
0
        private static bool TryAssertDateTimeConstantAsType(IEdmDateTimeConstantExpression expression, IEdmTypeReference type, out IEnumerable <EdmError> discoveredErrors)
        {
            if (!type.IsDateTime())
            {
                discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) };
                return(false);
            }

            discoveredErrors = Enumerable.Empty <EdmError>();
            return(true);
        }
Esempio n. 2
0
 internal void WriteDateTimeConstantExpressionElement(IEdmDateTimeConstantExpression expression)
 {
     this.xmlWriter.WriteStartElement(CsdlConstants.Element_DateTime);
     this.xmlWriter.WriteString(EdmValueWriter.DateTimeAsXml(expression.Value));
     this.WriteEndElement();
 }
Esempio n. 3
0
 protected virtual void ProcessDateTimeConstantExpression(IEdmDateTimeConstantExpression expression)
 {
     this.ProcessExpression(expression);
 }
Esempio n. 4
0
 protected override void ProcessDateTimeConstantExpression(IEdmDateTimeConstantExpression expression)
 {
     this.schemaWriter.WriteDateTimeConstantExpressionElement(expression);
 }
Esempio n. 5
0
		private static bool TryAssertDateTimeConstantAsType(IEdmDateTimeConstantExpression expression, IEdmTypeReference type, out IEnumerable<EdmError> discoveredErrors)
		{
			if (type.IsDateTime())
			{
				discoveredErrors = Enumerable.Empty<EdmError>();
				return true;
			}
			else
			{
				EdmError[] edmError = new EdmError[1];
				edmError[0] = new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType);
				discoveredErrors = edmError;
				return false;
			}
		}