public static void SetScaleMeasuresAnnotation(this EdmModel model, IEdmProperty property, byte scale) { if (model == null) throw new ArgumentNullException("model"); if (property == null) throw new ArgumentNullException("property"); var target = property; var term = ScaleTerm; var expression = new EdmIntegerConstant(scale); var annotation = new EdmAnnotation(target, term, expression); annotation.SetSerializationLocation(model, property.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }
public static void SetISOCurrencyMeasuresAnnotation(this EdmModel model, IEdmProperty property, string isoCurrency) { if (model == null) throw new ArgumentNullException("model"); if (property == null) throw new ArgumentNullException("property"); var target = property; var term = ISOCurrencyTerm; var expression = new EdmStringConstant(isoCurrency); var annotation = new EdmAnnotation(target, term, expression); annotation.SetSerializationLocation(model, property.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }
public static void SetISOCurrencyMeasuresAnnotation(this EdmModel model, IEdmProperty property, string isoCurrency) { if (model == null) { throw new ArgumentNullException("model"); } if (property == null) { throw new ArgumentNullException("property"); } var target = property; var term = ISOCurrencyTerm; var expression = new EdmStringConstant(isoCurrency); var annotation = new EdmAnnotation(target, term, expression); annotation.SetSerializationLocation(model, property.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }
public static void SetScaleMeasuresAnnotation(this EdmModel model, IEdmProperty property, byte scale) { if (model == null) { throw new ArgumentNullException("model"); } if (property == null) { throw new ArgumentNullException("property"); } var target = property; var term = ScaleTerm; var expression = new EdmIntegerConstant(scale); var annotation = new EdmAnnotation(target, term, expression); annotation.SetSerializationLocation(model, property.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }
public static void SetPermissionsCoreAnnotation(this EdmModel model, IEdmProperty property, CorePermission value) { if (model == null) { throw new ArgumentNullException("model"); } if (property == null) { throw new ArgumentNullException("property"); } var target = property; var term = PermissionsTerm; var name = new EdmEnumTypeReference(PermissionType, false).ToStringLiteral((long)value); var expression = new EdmEnumMemberReferenceExpression(PermissionType.Members.Single(m => m.Name == name)); var annotation = new EdmAnnotation(target, term, expression); annotation.SetSerializationLocation(model, property.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }