2014-02-21 4 views
0

안녕하세요, 내 linq 쿼리를 작성하는 데 어려움이 있습니다. Where 절을 넣을 곳이 확실하지 않습니다. 나는이 코드를 삽입 할 또는 내가 어떻게 그것을 위의 구문 도와 드리겠습니다 방식으로 그것을 쓰기 할문제가 Linq Where 절

using (var ctx = DB.Get()) 
     { 
      Interaction = new BindableCollection<InteractionDTO>(
       ctx.Interactions.Select(
       x => new InteractionDTO 
       { 
        Indepth = x.Indepth 
       } 
       ) 
      ); 
     } 

. 이 같은 where date>= StartDate.SelectedDate.Value

+0

인가 시도 작동합니다'date' 나''Interactions'의 멤버를 StartDate'? –

+0

날짜가 상호 작용의 구성원입니다 혼란에 대해 죄송합니다. – Master

답변

2

뭔가

ctx.Interactions. 
    .Where(x => x.date >= StartDate.SelectedDate.Value) 
    .Select(x => new InteractionDTO 
      { 
       Indepth = x.Indepth 
      }) 
2

이 하나

  ctx.Interactions 
      .where (x=> date >=x.StartDate) 
      .Select(x => new InteractionDTO 
      { 
       Indepth = x.Indepth 
      });