주 메뉴 열기

wwiki β

Expression trees

x<y처럼 각 노드가 expression(식)인 트리 형식 데이터 구조(tree-like data structue)의 코드이다.

실행가능한 코드를 동적으로 수정하고 다양한 데이터베이스에서 LINQ쿼리를 실행하고, 동적 쿼리를 만들 수 있다.

System.Linq.Expressions 네임스페이스를 사용하여 expression tree를 수동으로 만들수도 있다.

목차

Creating Expression Trees from Lambda Expressions편집

다음 코드는 5보다 작은 값일 때 bool을 리턴하는 expression tree를 만드는 방법을 보여준다.

Expression<Func<int, bool>> lambda = num => num < 5;

Create Expression Trees by Using the API편집

Parsing Expression Trees편집

Immutability of Expression Trees편집

Compiling Expression Trees편집

See also편집