Expression trees

wwiki
이동: 둘러보기, 검색

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[편집 | 원본 편집]