Description
Assuming this code:
var config = new ClientConfiguration();
|
var jsonSettings = new JsonSerializerSettings
|
{
|
Binder = SerializationBinder,
|
TypeNameHandling = TypeNameHandling.All,
|
};
|
config.Serializer = () => new DefaultSerializer(jsonSettings, jsonSettings);
|
var cluster = new Cluster(config);
|
var bucket = cluster.OpenBucket("MyBucket");
|
var context = new BucketContext(bucket);
|
Queries will fail at this line:
|
|
//ExtendedTypeSerializerMemberNameResolver.cs
|
|
public bool TryResolveMemberName(MemberInfo member, out string memberName)
|
{
|
memberName = null;
|
|
if (member == null)
|
return false;
|
|
memberName = _serializer.GetMemberName(member); //BOOM, here
|
|
return memberName != null;
|
}
|
By setting a ContractResolver = new CamelCasePropertyNamesContractResolver() on the json settings, this problem is resolved.
The BucketContext should probably throw if the client configuration does not provide the above.
Attachments
Issue Links
- is duplicated by
-
NCBC-1155 DefaultSerializer.GetMemberName throws NullReferenceException if ContractResolver is null
- Closed