Ability to assign IEnumerable/IQueryable from DataManager making OData Call

Is it possible to assign a variable that is a IEnumerable/IQueryable with the data retrieved from a Data Manager? I want to do this so that I can use this data elsewere in my Blazor page. 

For example....

Url=@(Configuration["api"] + "/odata/information") Adaptor="Adaptors.ODataV4Adaptor">

IQueryable query = result of above?

I return a IQueryable from my api if that makes any difference.

Thanks!

1 Reply 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team April 30, 2021 02:44 PM UTC

Hi Oscar, 

Greetings from Syncfusion. 
 
Query: Is it possible to assign a variable that is a IEnumerable/IQueryable with the data retrieved from a Data Manager? For example.... Url=@(Configuration["api"] + "/odata/information") Adaptor="Adaptors.ODataV4Adaptor"> IQueryable query = result of above? 

We have validated your query and you want to get the data from DataManager assign to a variable. You can achieve your requirement by using below way. Find the below code snippets for your reference. 

 
<button @onclick="Get">Get Data</button> 
 
<SfDataManager @ref="@SfM" Url=https://services.odata.org/V4/Northwind/Northwind.svc/Orders/ Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> 
 
@code{ 
    SfDataManager SfM; 
    Query Qry = new Query(); 
    public class Order 
    { 
        public int? OrderID { get; set; } 
        . . . 
    } 
 
 
    public async Task Get() 
    { 
        var data = await SfM.ExecuteQuery<Order>(Qry); 
    } 
} 
 

If it does not meet your requirement or if we misunderstood your requirement, then could you please share more information. 

Regards, 
Rahul 


Marked as answer
Loader.
Up arrow icon