You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Conventions related to request handling

UseParallelMultiGet

Instruct the client to do parallel MultiGet processing when handling lazy requests. This is enabled by default.

Conventions.UseParallelMultiGet = true;

AllowMultipuleAsyncOperations

Enable or disable multiple async requests per client instance. By default only a single concurrent async request is allowed.

Conventions.AllowMultipuleAsyncOperations = false;

HandleForbiddenResponseAsync

The async function that begins the handling of forbidden responses.

Conventions.HandleForbiddenResponseAsync = (forbiddenResponse, credentials) => 

HandleUnauthorizedResponseAsync

It begins the handling of unauthenticated responses, usually by authenticating against the oauth server in async manner.

Conventions.HandleUnauthorizedResponseAsync = (unauthorizedResponse, credentials) =>

CustomizeJsonSerializer

If you need to modify the JsonSerializer object used by the client, you can register a customization action:

Conventions.CustomizeJsonSerializer = serializer => { };

JsonContractResolver

The default the JsonContractResolver used by RavenDB will serialize all properties and all public fields. You can change it by providing your own implementation of IContractResolver interface:

Conventions.JsonContractResolver = new CustomJsonContractResolver();

public class CustomJsonContractResolver : IContractResolver
{
	public JsonContract ResolveContract(Type type)
	{
		throw new CodeOmitted();
	}
}

PreserveDocumentPropertiesNotFoundOnModel

Controls whether properties that were not de-serialized to object properties will be preserved when the document is saved again. If false, those properties will be removed when the document is saved. Default: true.

Conventions.PreserveDocumentPropertiesNotFoundOnModel = true;

RequestTimeSlaThresholdInMilliseconds

The threshold defined for SLA (Service Level Agreement). If requests to a node take longer than the defined threshold, the client will balance the load and send less requests to that node.

Conventions.RequestTimeSlaThresholdInMilliseconds = 75;