Questions tagged [microsoft-odata]

20 questions
18
votes
2 answers

Microsoft OData in .NET CORE 5 - Adding OData to services throws up a missing using directive yet the package is there

I am developing in .net core 5.0. (There is a tutorial by Sam Xu on moving to dotnet core 5) I have gone back to the absolute bare minimum with the most simple API project in Visual Studio. I had this working in my project earlier in the year and it…
si2030
  • 3,895
  • 8
  • 38
  • 87
6
votes
1 answer

OData Doesn't Recognize My Collection Properties

When I post a ShakeoutDocument without the collections populated, the OData Serializer understands the JSON & populates the ODataActionParameters correctly. However, when I add a child-record into either of the ShakeoutDocument's collection…
Prisoner ZERO
  • 13,848
  • 21
  • 92
  • 137
4
votes
1 answer

MS Graph API: OrderBy does not work when Expand is used (Groups - Members)

Issue: I am retrieving Group Members using Microsoft Graph API. I need to order the results based on the 'displayName'. Doing this on its own, works fine. I also need to know whether the members returned potentially has any of its own members. I…
3
votes
0 answers

UnexpectedXmlAttribute when using ODataLib v7

I am trying to use a sample v4 OData service http://services.odata.org/V4/OData/OData.svc/ with the new OData v7. When I call ODataMessageReader.ReadMetadataDocument I am getting a UnexpectedXmlAttribute exception. Is it possible to ignore the…
Andrey Belykh
  • 2,578
  • 4
  • 32
  • 46
3
votes
2 answers

How can I create complex values in Microsoft.OData.Core when ODataComplexValue is missing in version 7?

I'm parsing metadata from an OData service using Microsoft.OData (ODataLib) version 7. After parsing the ODataModel, I want to create an example message with sample values for all declared properties. So far so good. Works for primitive values in…
Christoph
  • 253
  • 1
  • 3
  • 9
2
votes
0 answers

Microsoft's OData Client Generated Classes do not Compile

We are trying to use Microsoft's OData Client to generate C# classes for our custom entities in Microsoft Dynamics. We add the "OData Connected Service" extension to Visual Studio and connect to the Dynamics $metadata endpoint to generate the client…
Tom Baxter
  • 2,110
  • 2
  • 19
  • 38
2
votes
1 answer

odata datetimeoffset filter fails with positive timezone

I'm experiencing an issue with odata filtering. I have simplified my scenario to the following: I have the model built up like this: public class MyModel { public int ID { get; set; } public DateTimeOffset DATE { get; set; } } Controller…
Mark
  • 31
  • 4
2
votes
1 answer

AspnetCore Odata How do create an asynchronous action calling an await-able query

Here is my ODATA controller with an ODATA action. public class MyController : ODataController { private readonly Repository_repo; public MyController(IRepository repo) { _repo = repo; } [EnableQuery(PageSize = 10,…
Foysal94
  • 565
  • 2
  • 7
  • 15
0
votes
0 answers

In Microsoft Odata client, how to send empty json object in body?

I use Microsoft.OData.Client to call a function on an entity. I got an serialization erro back from the api. The api needs a empty {} body in the request to work properly. Is that possible to achive using Microsoft.OData.Client? Maybe there is a…
Erik Z
  • 4,660
  • 6
  • 47
  • 74
0
votes
0 answers

How to allow special characters in OData unbound function when string parameter is passed?

I am creating an unbound function into an OData 18.2 v4 service in .net. The function is declared as follows: WebApi Route Config: modelBuilder .Function("MyFunction1") .ReturnsCollection() .Parameter("parameter1"); …
Zoyeb Shaikh
  • 301
  • 1
  • 11
0
votes
0 answers

Odata web-api, How Filter apply on SQL View

http://localhost:8085/odata/ViewItemHistories?$filter=SalesLineId eq 1 and SalesOrdno eq 'SO-00001' and SoLnStatus eq 'Closed' we have Odata V3 Configured Web Api and one of Table has Thousand of records we have created SQL view so far and…
Zoyeb Shaikh
  • 301
  • 1
  • 11
0
votes
0 answers

Microsoft.AspNetCore.OData 8.0.10 routing issue

I am using ASP.NET Core 5.0 Web api project. On top of this project I have installed Microsoft.AspNetCore.OData 8.0.10 nuget package to enable OData support. This is how my routes are currently setup: [ApiController] [Route("api/[controller]")] …
OpenStack
  • 5,048
  • 9
  • 34
  • 69
0
votes
1 answer

How do I get Microsoft.OData.Client to Associate tables on update?

I have tested this request (to Microsoft Dynamics 365 CRM) in postman and it works correctly: POST request to https://example.com/api/data/v9.2/foo_module?$select=foo_moduleid Headers include: Prefer:return=representation Body { …
Myster
  • 17,704
  • 13
  • 64
  • 93
0
votes
0 answers

Escaping JSON Strings in an ASP.NET Web API Using OData

I have an ASP.NET Web API on .NET Core 3.1 using the Microsoft.AspNetCore.OData package to implement several OData controllers. One of the models has a string field used to hold HTML, and I am using the model in the request body for one of the OData…
JBoy
  • 11
  • 6
0
votes
0 answers

ODataClient: Executing DataServiceActionQueries in a batch

I'm migrating from SimpleOdataClient to MS ODataClient and I wonder how to execute DataServiceActionQueries in a batch. Executing DataServiceRequests in a batch is not a problem, but I haven't found a solution for DataServiceActionQueries. Is it…
krombi
  • 504
  • 1
  • 4
  • 15
1
2