Using Couchbase.N1QL; foreach(var q in query.Take(1)) gives null ref. exception on bucketname in Query

n1ql

#1

I have just started with Couchbase and I am stuck with a error that I cant seem to get past.

var db = new BucketContext(ClusterHelper.GetBucket(“EventSample”));

        var query = from x in db.Query<EventCode>()
                    where x.type == "eventcode"
                    select x;
        foreach(var q in query.Take(1))  <----- Get a error here BucketName = 'query.BucketName' threw an exception of type 'System.NullReferenceException'
        {

        }

#2

Which SDK are you using? You might want to submit the question to the relevant SDK category in the forums.


#3

@neal.opperman can you share the logs by chance? then @jmorris will have it easier to debug your issue - thanks!


#4

@neal.opperman

Also, you can provide the version numbers of the .Net SDK and the Linq2Couchbase library you are using?

Brant