How to write this Linq SQL as a Dynamic Query (using strings)?

后端 未结 2 1435
别跟我提以往
别跟我提以往 2021-01-02 21:36

Skip to the \"specific question\" as needed. Some background:

The scenario: I have a set of products with a \"drill down\" filter (Query Object) p

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 21:47

    If you take a look at C# Bits, the author discusses how to create cascading filters using Dynamic Data. It does not sound like you are using Dynamic Data, but he does have a nice expression builder that might be helpful to you. See BuildQueryBody, and then the following section of extension methods on Iqueryable.

    Since you are not using Dynamic Data, you will need to deal with not having access to a "MetaForeignKeyColumn" object, but I suspect his approach might help you with your question.

    I hope this helps.

提交回复
热议问题