Hello.
We’re at the early stage of developing an application and when querying a bucket with a very simple N1QL sentence the result contains empty rows. I mean, there are 3 objects to retrieve with that QUery and the result object contains 3 rows but each one of them are with their empty properties.
The query is in C#, using the latest SDK 2.2.5 and 4.0 Server version.
This is the query that returns a correct number of Rows but with empty objects.
var N1QL = “select * from aiberouting_internal where type=‘tenantconfig’”;
var result = couchbaseBucket_internal.Query(N1QL);
If I change this to dynamic type then the objects are full, but it’s very annoying for me working with the dynamic result when I can use the exact type. The dynamic result also includes an object with a property named as the bucket name, may be this could give a tip about the problem? I haven’t found more documentation about this and I’m really missing.
var result = couchbaseBucket_internal.Query(N1QL);
<< Sorry, I had to delete this image because new users can only post one image! >>
<< The object is retrieved full:
{ “aiberouting_internal”: { “active”: true, “licensed_channels”: 10, “licensed_users”: 20, “tenant”: “DATA”, “tenant_id”: “DATA1”, “type”: “tenantconfig” }} >>
This is the object in the bucket as shown via Web Manager:
{
“tenant”: “DATA”,
“tenant_id”: “DATA1”,
“licensed_users”: 20,
“licensed_channels”: 10,
“active”: true,
“type”: “tenantconfig”
}
This is the class definition:
public class TenantConfig
{
public string tenant { get; set; }
public string tenant_id { get; set; }
public int licensed_users { get; set; }
public int licensed_channels { get; set; }
public bool active { get; set; }
public string type { get; set; }
}
As a workaround… Is there any way to convert the dynamic object to the .NET class after retrieving it with the dynamic succesful query?
Thank you.