Search through Where clause in LINQ, using dynamic properties

前端 未结 4 1194
长情又很酷
长情又很酷 2021-01-12 17:58

I\'m basically trying to construct a query, and I don\'t know why microsoft made this so difficult in Entity Framework and LINQ. I have various parameter STRINGS. So if you

4条回答
  •  我在风中等你
    2021-01-12 18:57

    this should be incredibly easy and simple for a modern language

    No, it should not if it goes against that language paradigm. LINQ and Entity Framework (as well as any other decent ORM out there) are made precisely to avoid what you're trying to accomplish: non-typed and non-compiler-verifiable queries. So basically you're forcing square peg into round hole.

    You can still take a look at Dynamic LINQ.

提交回复
热议问题