We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
HasDescription<TEntity>(this NavigationSourceConfiguration<TEntity> navigationSource)
OData ModelBuilder 1.0.9
Create a simple console project.
dotnet new console --use-program-main dotnet add package Microsoft.OData.ModelBuilder --version 1.0.9 dotnet add package Microsoft.OData.Edm --version 7.9.4
Paste the following into Program.cs
Program.cs
using Microsoft.OData.Edm; using Microsoft.OData.ModelBuilder; namespace odata_core_vocab_fault; record Book(string ISBN); class Program { static void Main(string[] args) { var builder = new ODataConventionModelBuilder(); var books = builder.EntitySet<Book>("Books"); books .EntityType .HasKey(e => e.ISBN); books .HasDescription() .HasDescription("A collection of books."); var edmModel = builder.GetEdmModel(); var entityset = edmModel.FindDeclaredEntitySet("Books"); var description = edmModel.GetDescriptionAnnotation(entityset); Console.WriteLine(description); } }
The console prints "A collection of books."
The console prints nothing. Inspecting the result while debugging shows description as null.
description
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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: