首页 > 解决方案 > How to set up an Odata service that supports $crossjoin, hosted on ASP.net core or separately

问题描述

I'm working on a new web application in ASP.net core and currently use the OData WebApi. The issue I'm currently having is that one OData feature I want to use $Crossjoin is not supported by the web api. Also noted in this question from 2 years ago. And I have not seen any updates since.

Essentially I want to be able to use a query like this with Odata and have my application hosted on ASP.net Core:

http://host/service/$crossjoin(Products,Sales)?
                                    $filter=Products/ID eq Sales/ProductID

So right now I'm assuming there is no way to get $Crossjoin to work with WebAPI. Are there any libraries that will support that protocol and can also be hosted on ASP.net core or at the same time? One that I came across OData V4 Service modules - SQL Connector that I can host using node.

The reason why I would like to use Crossjoin is because I cannot modify tables or add views to the database I am accessing. It does not use Primary or Foreign Keys. And I will want to be be able to join on multiple properties. I am also early into building my application so I don't mind migrating my current WebApi to something else to save me time in the future.

To have an idea of how my application looks, it is based off the ASP.NET Core Vue Starter template with Typescript. I am also using Microsoft SQL Server 2012, and Entity Framework Core.

Any suggestions are greatly appreciated, thank you.

标签: c#asp.net.netodata

解决方案


推荐阅读