see on GitHub

Conventions related to request handling

MaxHttpCacheSize

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

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

Note

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

ThrowIfQueryPageSizeIsNotSet

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;

Note

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.

CustomizeJsonSerializer

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

Conventions.CustomizeJsonSerializer = serializer => { };

JsonContractResolver

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();
    }
}

PreserveDocumentPropertiesNotFoundOnModel

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;

MaxNumberOfRequestsPerSession

Gets or sets maximum number of GET requests per session

Conventions.MaxNumberOfRequestsPerSession = 10;

UseOptimisticConcurrency

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

Conventions.UseOptimisticConcurrency = true;