Hi,
I’m trying to evaluate linq2CouchBase for a new project.
I got NiQL query working but the linq query doesn’t
Any advice on trouble-shooting would be greatly appreciated!
TIA,
Michael
Here’s the call stack:
System.NullReferenceException: Object reference not set to an instance of an object.
at Couchbase.Linq.Execution.BucketQueryExecutor.ExecuteCollection(QueryModel queryModel, Boolean selectDocumentMetadata, ScalarResultBehavior& scalarResultBehavior)
at Couchbase.Linq.Execution.BucketQueryExecutor.ExecuteCollection[T](QueryModel queryModel)
at Couchbase.Linq.Execution.BucketQueryExecutor.ExecuteSingle[T](QueryModel queryModel, Boolean returnDefaultWhenEmpty)
at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteSingleQueryModel[T](QueryModel queryModel, IQueryExecutor executor)
at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
at Remotion.Linq.QueryModel.Execute(IQueryExecutor executor)
at Remotion.Linq.QueryProviderBase.Execute(Expression expression)
at Remotion.Linq.QueryProviderBase.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.First[TSource](IQueryable`1 source)Here’s the test code:
[TestMethod] //this works
public void TestNiql()
{
var bucket = GetBucket();
var beer = bucket.Query(@“SELECT * FROMbeer-sample
WHERE type=”“brewery”" LIMIT 1;");
Assert.IsNotNull(beer);
}
[TestMethod]
public void TestLinq()
{
var bucket = GetBucket();
var db = new BeerSample(bucket);
var beer = db.Beers.First();
Assert.IsNotNull(beer);
}