I am quite new to Couchbase. Trying to query it via Linq2Couchbase and running into issues.
here is what my code looks like
var prefBucket = ClusterHelper.GetBucket("preferences");
var db = new BucketContext(prefBucket);
var query = from b in db.Query<Preference>()
select b;
foreach (Preference p in query)
{
results.Add(p);
}
For some reason the Bucket object in bucketcontext/query is always null.
Not sure what I am missing.
That is very unusual. I’ve checked the code, and I don’t see how it gets to be null other than it being passed into the constructor. The field is marked as read only.
A few other questions:
Are you using a special environment like Mono, or is this in the good old fashioned .Net framework?
Are you using Linq2Couchbase 1.0.2?
Can you provide an example project, maybe in GitHub, that reproduces the problem?