Home

Using OData Files Generated by OData-Cli in LINQPad

Hello,

I'm currently working with OData files generated via OData-Cli, specifically Reference.cs and OData ServiceCsdl.xml.
I'm seeking advice on the best method to utilize these files within LINQPad.
For Reference.cs, I presume the #load directive could be appropriate.
However, I'm uncertain about integrating OData ServiceCsdl.xml.
Typically, in a standard project, we insert the following XML into the csproj file to manage this:

<ItemGroup>
    <None Remove="Connected Services\OData Service\OData ServiceCsdl.xml" />
</ItemGroup>
<ItemGroup>
    <EmbeddedResource Include="Connected Services\OData Service\OData ServiceCsdl.xml" />
</ItemGroup>

Is there a similar or alternative method in LINQPad that avoids modifying the Reference.cs file directly?

On a related note, I suggest an enhancement for LINQPad: integrating odata-cli as a "Connection" option.
Enabling OData-Cli as a connection type would significantly simplify connecting to OData services and improve user experience.

For reference, here's the command I use to generate these files:

odata-cli generate -et -iue -m "http://host.docker.internal:5000/odata" -o "Connected Services\OData Service"
Sign In or Register to comment.