Hi,
I have a simple using Linq2CouchaBase.
I have a simple testing using NiQL that works fine.
The Linq2CouchBase throws a NRE from within the API.
Any advice troubleshooting this would be greatly appreciated!
Micky
the code
[TestMethod] //this works
public void TestNiql()
{
var bucket = GetBucket();
var beer = bucket.Query<Beer>(@"SELECT * FROM `beer-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);
}
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)