protected EdmMultiplicity RequiredMultiplicity(string attributeName) { XmlAttributeInfo attr = this.GetRequiredAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { switch (attr.Value) { case CsdlConstants.Value_EndRequired: return(EdmMultiplicity.One); case CsdlConstants.Value_EndOptional: return(EdmMultiplicity.ZeroOrOne); case CsdlConstants.Value_EndMany: return(EdmMultiplicity.Many); default: this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMultiplicity, Strings.CsdlParser_InvalidMultiplicity(attr.Value)); break; } } return(EdmMultiplicity.One); }
protected string RequiredQualifiedName(string attributeName) { XmlAttributeInfo attr = this.GetRequiredAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { return(this.ValidateQualifiedName(attr.Value)); } return(null); }
protected string OptionalType(string attributeName) { XmlAttributeInfo attr = this.GetOptionalAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { return(this.ValidateTypeName(attr.Value)); } return(null); }
protected string RequiredEnumMemberPath(string attributeName) { XmlAttributeInfo attr = this.GetRequiredAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { return(this.ValidateEnumMemberPath(attr.Value)); } return(null); }
protected bool?OptionalBoolean(string attributeName) { XmlAttributeInfo attr = this.GetOptionalAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { bool?value; if (!EdmValueParser.TryParseBool(attr.Value, out value)) { this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidBoolean, Strings.ValueParser_InvalidBoolean(attr.Value)); } return(value); } return(null); }
protected int?OptionalMaxLength(string attributeName) { XmlAttributeInfo attr = this.GetOptionalAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { int?value; if (!EdmValueParser.TryParseInt(attr.Value, out value)) { this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMaxLength, Strings.ValueParser_InvalidMaxLength(attr.Value)); } return(value); } return(null); }
protected EdmOnDeleteAction RequiredOnDeleteAction(string attributeName) { XmlAttributeInfo attr = this.GetRequiredAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { switch (attr.Value) { case CsdlConstants.Value_None: return(EdmOnDeleteAction.None); case CsdlConstants.Value_Cascade: return(EdmOnDeleteAction.Cascade); default: this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidOnDelete, Strings.CsdlParser_InvalidDeleteAction(attr.Value)); break; } } return(EdmOnDeleteAction.None); }
protected int?OptionalScale(string attributeName) { XmlAttributeInfo attr = this.GetOptionalAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { int?scale; if (attr.Value.EqualsOrdinalIgnoreCase(CsdlConstants.Value_ScaleVariable)) { scale = null; } else { if (!EdmValueParser.TryParseInt(attr.Value, out scale)) { this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidSrid, Strings.ValueParser_InvalidScale(attr.Value)); } } return(scale); } return(CsdlConstants.Default_Scale); }
protected string Required(string attributeName) { XmlAttributeInfo attr = this.GetRequiredAttribute(this.currentElement, attributeName); return(!attr.IsMissing ? attr.Value : string.Empty); }
protected string Optional(string attributeName) { XmlAttributeInfo attr = this.GetOptionalAttribute(this.currentElement, attributeName); return(!attr.IsMissing ? attr.Value : null); }