question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OData WebApi over Linq2Db

See original GitHub issue

I write web-service worked by OData protocol. As data access layer using L2DB. If odata query include expand option, the result expression throw error: Multiple queries are not allowed. Set the 'LinqToDB.Common.Configuration.Linq.AllowMultipleQuery' flag to 'true' to allow multiple queries.

Executable query:

db.GetTable<Department>()
                .Select(Param_0 => new SelectAllAndExpand()
                {
                    ModelID = "2cd45fee-a6aa-4d0e-9024-0a7fbc48e50b",
                    Instance = Param_0,
                    Container = new NamedProperty()
                    {
                        Name = "DepartmentHierarchyToDepartmentsChildren",
                        Value = IIF(
                                  IIF((Param_0 == null), null, Param_0.DepartmentHierarchyToDepartmentsChildren) == null,
                                  null,
                                  IIF((Param_0 == null), null, Param_0.DepartmentHierarchyToDepartmentsChildren)
                                    .Select(Param_1 => new SelectAll
                                    {
                                        ModelID = "2cd45fee-a6aa-4d0e-9024-0a7fbc48e50b",
                                        Instance = Param_1
                                    })
                                )
                    }
                });

How to fix this error without AllowMultipleQuery=true

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
genusPcommented, May 10, 2017

It turns out that LoadWith allows you to load data for an association many to one? Облом

0reactions
ilicommented, May 12, 2017

Will close for now 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

using LinqToSql with OData WebApi?
I am looking for a ODataModelBuilder that works with System.Data.Linq.Mapping to make the model. The other solution is to find the correct set ......
Read more >
SkipQueryOption.ApplyTo Method
The query settings to use while applying this query option. Returns. IQueryable. The new IQueryable after the skip query has been applied to....
Read more >
Libraries · OData - the Best Way to REST
LINQ -enabled client API for issuing OData queries and consuming OData JSON payloads. It's the V4 version of the former WCF Data Services...
Read more >
Is using OData\IQueryable in your Web API an inherently bad ...
Using IQueryable to work with OData is like using EF with Linq2Sql, it is a way of accessing data and it's nothing wrong...
Read more >
RESTier
RESTier is a RESTful API development framework for building standardized, OData V4 based RESTful services on .NET platform. It can be seen as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found