Open chrisspre opened 3 years ago
Microsoft.AspNetCore.OData 7.5.8 includes the built-in model builder.
Microsoft.OData.ModelBuilder is separated from Microsoft.OData.ModelBuilder 7.x
and includes the same class names.
you can use the full type name, for example: "Microsoft.OData.ModelBuilder.ODataConventionModelBuilder" to get rid of the ambiguous.
@chrisspre did Sam's advice resolve the issue?
I got this from https://docs.microsoft.com/en-us/odata/webapi/model-builder-capabilities-vocabulary
@xuzhg the key is to be able to use the extension method houses.HasCountRestrictions().IsCountable(true);
on the EntityTypeConfiguration returned by the WebAPI's ModelBuilder .
But I also need to start with Microsoft.AspNetCore.OData.Builder.ODataConventionModelBuilder for the comple ASP.NET infrastructure, right?
Is there an equivalent in Microsoft.OData.ModelBuilder 7.x a to add capability annotations ?
Just tried
I have a small project in
<TargetFramework>net6.0</TargetFramework>
and include the following two packages.The code
does not compile with error
Adding
using Microsoft.OData.ModelBuilder;
gives error: