Skip to content

Customized entity set with customized entity type will fail during query #460

Description

@chinadragon0515

In Api class, defined a customized entity set with customized entity type and use model extend to add the customized entity type, the query will fail.


message: "Element type cannot be found for 'PeopleWithAge'.",
type: "System.NotSupportedException",
stacktrace: "   at Microsoft.Restier.Core.ApiContextExtensions.EnsureElementType(ApiContext context, String namespaceName, String name) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Core\ApiContextExtensions.cs:line 542
   at Microsoft.Restier.Core.ApiContextExtensions.SourceCore(ApiContext context, String namespaceName, String name, Object[] arguments) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Core\ApiContextExtensions.cs:line 480
   at Microsoft.Restier.Core.ApiContextExtensions.GetQueryableSource(ApiContext context, String name, Object[] arguments) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Core\ApiContextExtensions.cs:line 260
   at Microsoft.Restier.Core.ApiBaseExtensions.GetQueryableSource(ApiBase api, String name, Object[] arguments) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Core\ApiBaseExtensions.cs:line 84
   at Microsoft.Restier.Publishers.OData.Query.RestierQueryBuilder.HandleEntitySetPathSegment(ODataPathSegment segment) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Publishers.OData\Query\RestierQueryBuilder.cs:line 184
   at Microsoft.Restier.Publishers.OData.Query.RestierQueryBuilder.BuildQuery() in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Publishers.OData\Query\RestierQueryBuilder.cs:line 74
   at Microsoft.Restier.Publishers.OData.RestierController.GetQuery(ODataPath path) in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Publishers.OData\RestierController.cs:line 497
   at Microsoft.Restier.Publishers.OData.RestierController.<Get>d__7.MoveNext() in D:\dev\githome\RESTier.vin\src\Microsoft.Restier.Publishers.OData\RestierController.cs:line 83

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions