You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingMicrosoft.OData.Edm;usingMicrosoft.OData.ModelBuilder;namespaceodata_core_vocab_fault;recordBook(stringISBN);classProgram{staticvoidMain(string[]args){varbuilder=newODataConventionModelBuilder();varbooks=builder.EntitySet<Book>("Books");books.EntityType.HasKey(e =>e.ISBN);books.HasDescription().HasDescription("A collection of books.");varedmModel=builder.GetEdmModel();varentityset=edmModel.FindDeclaredEntitySet("Books");vardescription=edmModel.GetDescriptionAnnotation(entityset);Console.WriteLine(description);}}
Expected result
The console prints "A collection of books."
Actual result
The console prints nothing. Inspecting the result while debugging shows description as null.
The text was updated successfully, but these errors were encountered:
The DescriptionConfiguration class returned by extension methods such as
HasDescription<TEntity>(this NavigationSourceConfiguration<TEntity> navigationSource)
returns a record edm expression, while methods in the EDM library such as GetLongDescriptionAnnotation(this IEdmModel model, IEdmVocabularyAnnotatable target) expects it to be IEdmStringConstantExpression. The vocabulary at the OASIS-TC also specifies that the annotation should be a string.Assemblies affected
OData ModelBuilder 1.0.9
Reproduce steps
Create a simple console project.
Paste the following into
Program.cs
Expected result
The console prints "A collection of books."
Actual result
The console prints nothing. Inspecting the result while debugging shows
description
as null.The text was updated successfully, but these errors were encountered: