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