ساخت پویای عبارات LINQ
200, OK
https://blog.jeremylikness.com/blog/dynamically-build-linq-expressions/ icon

چگونه رشته‌ی JSON زیر را تبدیل به یک عبارت LINQ کنیم؟ (ساخت یک گزارش ساز پویا)

{
  "condition": "and",
  "rules": [
    {
      "label": "Category",
      "field": "Category",
      "operator": "in",
      "type": "string",
      "value": [
        "Clothing"
      ]
    },
    {
      "condition": "or",
      "rules": [
        {
          "label": "TransactionType",
          "field": "TransactionType",
          "operator": "equal",
          "type": "boolean",
          "value": "income"
        },
        {
          "label": "PaymentMode",
          "field": "PaymentMode",
          "operator": "equal",
          "type": "string",
          "value": "Cash"
        }
      ]
    },
    {
      "label": "Amount",
      "field": "Amount",
      "operator": "equal",
      "type": "number",
      "value": 10
    }
  ]
}
ساخت پویای عبارات LINQ