see on GitHub

Conventions related to request handling


If you need to modify the maximum http cache size, you can use the following setting:

Conventions.MaxHttpCacheSize = new Size(256,SizeUnit.Megabytes);


Default value of this setting is 512MB on 64 bits, 32MB on 32 bits


To decide if you would like to for any query in session to throw when no explicit page size set, you can use the following setting:

Conventions.ThrowIfQueryPageSizeIsNotSet = true;


From 4.0 there is no limitation for number of results returned from server. This can be useful for development purposes to pinpoint all the possible performance bottlenecks.


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

Conventions.CustomizeJsonSerializer = serializer => { };


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

Conventions.JsonContractResolver = new CustomJsonContractResolver();

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


Controls whatever properties that were not de-serialized to an object properties will be preserved during saving a document again. If false, those properties will be removed when the document will be saved. Default: true.

Conventions.PreserveDocumentPropertiesNotFoundOnModel = true;


Gets or sets maximum number of GET requests per session

Conventions.MaxNumberOfRequestsPerSession = 10;


Controls whether optimistic concurrency is set to true by default for all future sessions

Conventions.UseOptimisticConcurrency = true;