[Test]
public void Can_Get_All()
{
var repository = new RavenRepository<Motorcycle>();
repository.DeleteAll();
repository.Store(new Motorcycle {Make = "Datsun", YearManufactured = 1972});
repository.Store(new Motorcycle {Make = "Toyota", YearManufactured = 2002});
IList<Motorcycle> savedThings = repository.GetAll();
Assert.IsTrue(savedThings.Count == 2);
}
RavenRepository.GetAll()이 테스트를 실행RavenDB에서 모든 문서를 얻으려면 어떻게해야합니까?
public IList<T> GetAll()
{
using (IDocumentSession session = _collection.OpenSession())
{
return session.Query<T>().ToList(); // Throws exception
}
}
에서 예외가 발생합니다 :
Raven.Abstractions.Exceptions.IndexCompilationException : 쿼리를 이해 할 수 없습니다 : 변수 초기화를 선택하면 람다 식을 가지고 있어야합니다 객체 생성 표현식을 사용하여
왜? 어떻게 RavenDB에서 T 타입의 모든 문서를 얻을 수 있습니까?
설명서를 읽었을지라도 http://ravendb.net/은 2 시간 동안 다운되었습니다 ... –