public static void SetSearchRestrictionsCapabilitiesAnnotation(this EdmModel model, IEdmEntitySet entitySet, bool searchable, CapabilitiesSearchExpressions unsupported) { if (model == null) { throw new ArgumentNullException("model"); } if (entitySet == null) { throw new ArgumentNullException("entitySet"); } var target = entitySet; var term = SearchRestrictionsTerm; var name = new EdmEnumTypeReference(SearchExpressionsType, false).ToStringLiteral((long)unsupported); var properties = new IEdmPropertyConstructor[] { new EdmPropertyConstructor("Searchable", new EdmBooleanConstant(searchable)), new EdmPropertyConstructor("UnsupportedExpressions", new EdmEnumMemberReferenceExpression(SearchExpressionsType.Members.Single(m => m.Name == name))), }; var record = new EdmRecordExpression(properties); var annotation = new EdmAnnotation(target, term, record); annotation.SetSerializationLocation(model, entitySet.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }
public static void SetSearchRestrictionsCapabilitiesAnnotation(this EdmModel model, IEdmEntitySet entitySet, bool searchable, CapabilitiesSearchExpressions unsupported) { if (model == null) throw new ArgumentNullException("model"); if (entitySet == null) throw new ArgumentNullException("entitySet"); var target = entitySet; var term = SearchRestrictionsTerm; var name = new EdmEnumTypeReference(SearchExpressionsType, false).ToStringLiteral((long)unsupported); var properties = new IEdmPropertyConstructor[] { new EdmPropertyConstructor("Searchable", new EdmBooleanConstant(searchable)), new EdmPropertyConstructor("UnsupportedExpressions", new EdmEnumMemberReferenceExpression(SearchExpressionsType.Members.Single(m => m.Name == name))), }; var record = new EdmRecordExpression(properties); var annotation = new EdmAnnotation(target, term, record); annotation.SetSerializationLocation(model, entitySet.ToSerializationLocation()); model.AddVocabularyAnnotation(annotation); }