2
我有和現有的數據庫有3個表和它們之間的關係。其中兩個表具有名爲「Id」的主鍵列是整數列。第三個表具有一個複合主鍵,該主鍵由與其他兩個表(鏈接表或多對多)中的每一個有關的外鍵組成。現有數據庫已遷移到Azure並由Azure移動服務使用 - 標識屬性異常
我設置了一個新的Azure移動服務,並將此數據庫指定爲服務數據的來源。我爲.NET中的服務構建了控制器,模型和數據對象(DTO)。一切看起來正確的,但是當我試圖從任何表中請求數據,我得到這個錯誤:
{
message: "The query specified in the URI is not valid. Property 'Id' is of an unrecognized EdmPropertyKind."
exceptionMessage: "Property 'Id' is of an unrecognized EdmPropertyKind."
exceptionType: "Microsoft.Data.OData.ODataException"
stackTrace: " at Microsoft.Data.OData.Query.SyntacticAst.SelectPathSegmentTokenBinder.TryBindAsDeclaredProperty(PathSegmentToken tokenIn, IEdmEntityType entityType, ODataPathSegment& segment) at Microsoft.Data.OData.Query.SyntacticAst.SelectPathSegmentTokenBinder.ConvertNonTypeTokenToSegment(PathSegmentToken tokenIn, IEdmModel model, IEdmEntityType entityType) at Microsoft.Data.OData.Query.SyntacticAst.SelectPropertyVisitor.ProcessTokenAsPath(NonSystemToken tokenIn) at Microsoft.Data.OData.Query.SyntacticAst.SelectPropertyVisitor.Visit(NonSystemToken tokenIn) at Microsoft.Data.OData.Query.SyntacticAst.NonSystemToken.Accept(IPathSegmentTokenVisitor visitor) at Microsoft.Data.OData.Query.SyntacticAst.SelectBinder.Bind(SelectToken tokenIn) at Microsoft.Data.OData.Query.SelectExpandSemanticBinder.Parse(IEdmEntityType elementType, IEdmEntitySet entitySet, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration) at Microsoft.Data.OData.Query.ODataUriParser.ParseSelectAndExpandImplementation(String select, String expand, IEdmEntityType elementType, IEdmEntitySet entitySet) at System.Web.Http.OData.Query.SelectExpandQueryOption.get_SelectExpandClause() at System.Web.Http.OData.Query.Validators.SelectExpandQueryValidator.Validate(SelectExpandQueryOption selectExpandQueryOption, ODataValidationSettings validationSettings) at System.Web.Http.OData.Query.SelectExpandQueryOption.Validate(ODataValidationSettings validationSettings) at System.Web.Http.OData.Query.Validators.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings) at System.Web.Http.OData.Query.ODataQueryOptions.Validate(ODataValidationSettings validationSettings) at System.Web.Http.OData.EnableQueryAttribute.ValidateQuery(HttpRequestMessage request, ODataQueryOptions queryOptions) at System.Web.Http.OData.EnableQueryAttribute.ExecuteQuery(Object response, HttpRequestMessage request, HttpActionDescriptor actionDescriptor) at System.Web.Http.OData.EnableQueryAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)"
}
有誰知道我做錯了嗎?