DEV Community


Discussion on: An Introduction to C# Expression Trees

mokenyon profile image
Morgan Kenyon Author

Hi Mike, great question. I agree, at the end of the day if it adds complexity for complexities sake, it's not very useful.

I talk a little bit about the "portability" or expressions. Since expressions are code defined as a data structure, data structures can be passed around.

I also expand a bit on this topic in my second article. In real world, libraries like Entity Framework Core heavily use Expressions.

Linq queries are converted into Expressions, then those expressions are passed to the specific database formatters. Be it SqlServer, Oracle, Postgres, etc.

Expressions are definitely more of a feature targeting library developers versus web applications.

So more than likely you probably won't need to use them, but have used other nuget packages that use them heavily.