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

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'
        {

        }

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

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

@neal.opperman

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

Brant