2014-10-16 1 views
0

일부 OrmLite 도구를 사용하는 데 문제가 있습니다. 문서 데이터베이스를 너무 오랫동안 사용해 본 적이 있습니다.Join 쿼리에 Ormlite 예외가 발생했습니다.

public class ListingEvent 
{ 
    public ListingEvent() 
    { 

    } 

    [AutoIncrement] 
    [PrimaryKey] 
    public int Id { 
     get ; 
     set; 
    } 

    public string Name { get; set; } 

    [ForeignKey(typeof(Location))] 
    public int LocationId { 
     get; 
     set; 
    } 
} 

public class Location 
{ 
    public Location() 
    { 
     ListingEvents = new List<ListingEvent>(); 
    } 

    [AutoIncrement] 
    [PrimaryKey] 
    public int Id { 
     get ; 
     set; 
    } 

    public string Name { get; set; } 

    [Reference] 
    public List<ListingEvent> ListingEvents { get; set; } 
} 

그리고 다음 쿼리 :

지구에 왜
var listingEvents = db.Select<ListingEventDto> (
        db.From<Model.ListingEvent>() 
        .Join<Model.ListingEvent, Model.Location>() 
        .Where<Model.ListingEvent> (le => locationIds.Contains (le.LocationId) && le.Name.Contains (request.Query)) 
        .Or<Model.ListingEvent, Model.Location>((le, l) => l.Name.Contains(request.Query) == true) 
        .Limit (skip: request.Skip, rows: request.Take)); 

나는이 오류가 무엇입니까 (마음에 드러내는 나는이 모든 의미를 시도했다!) :

감안할 때 나는 다음과 같은 모델을 가지고 문제는
error CodeInvalidOperationException message variable 'l' of type 'Model.Location' referenced from scope '', but it is not defined 

답변

1

아래 식에 있었던 결합 표의 컬럼에있어서의 식, 즉 :

01,231,931,

이 문제는 in this commit에서 해결되었으므로 v4.0.33 +에서 사용 가능합니다. 즉 published to MyGet입니다.

+0

완벽하게 테스트되었고 지금은 매력처럼 작동합니다 - 건배 :) – iwayneo

관련 문제