none
.NET IQueryable MSSQL and ASP.NET WebAPI

    Pertanyaan

  • Hello,
    The case is following.
    There is DataGrid in WPF app which consume IQueryable as ItemsSource (apply Filtering, Sorting, Grouping, Aggregations, etc...) we have MSSQL Server DB where the data is stored if from app we directly connect to DB using EF DbSet<> or ADO.NET Table<> everything is work excellent. We do not want that app has direct access to DB and the purpose is to use WebAPI between them. The DataGrid has its own query generator expressions, the generated query is look like
        .Call System.Linq.Queryable.Select(
        .Call System.Linq.Queryable.GroupBy(
            .Call System.Linq.Queryable.Select(
                .Constant<Reports.ReportQuery>(Query(RepoService.Flight)),
                '(.Lambda #Lambda1<System.Func`2[RepoService.Flight,DynamicClass1]>)),
            '(.Lambda #Lambda2<System.Func`2[DynamicClass1,DynamicClass2]>)),
        '(.Lambda #Lambda3<System.Func`2[System.Linq.IGrouping`2[DynamicClass2,DynamicClass1],Telerik.Pivot.Core.PivotResultItem]>))


      As I understand OData is not suitable for our case. What we are trying to do is create our custom IQueryable and IQueryProvider get query expression in provider Execute method send it to WebAPI which then execute it on DB return result and return that result form provider Execute method.
    1) Is this way correct/possible?
    2) Is there some existing solutions for this case?


    Kamis, 27 September 2018 21.03

Semua Balasan

  • Hi Tuman_,

    This forum discuss and ask question about LINQ to SQL, since your issue is more relate to asp.net webapi, I would suggest that you could post your issue on asp.net webAPI forum suitable support.

    https://forums.asp.net/1246.aspx/1?Web+API

    Thanks for your understanding and cooperation.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Jumat, 28 September 2018 07.25