ConventionConfiguration Class

Used to configure the conventions used to e.g. determine index- and attributes names.

Definition

Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
public sealed class ConventionConfiguration
Inheritance
Object    ConventionConfiguration

Constructors

ConventionConfiguration Initializes a new instance of the ConventionConfiguration class.

Properties

DocumentIdGenerator Gets or sets a method that generates a document id for the given document. There is no default method. An exception will be thrown if no id generator has been configured and a document without a valid id (as determined by DocumentNeedsIdAssigned is about to be stored in an index.
DocumentNeedsIdAssigned Gets or sets a method that determines whether the given document needs to have an id assigned before saving. If not, DocumentIdGenerator will be called to generate an id which will then be assigned to the document. The default method will return false, if the id member (determined by IsIdMember) has a value greater 0, otherwise true.
GetAttributeName Gets or sets a method that returns the attribute name for the given property or field. The default uses the member name and converts it to all lower case letters.
GetIndexName Gets or sets the method that returns the index names(s) for the given type. The default converts the type name to lower case and pluralizes it (by appending an 's').
GetJsonFieldName Gets or sets a method that returns the field name for the given property or field of a JSON object. The default uses the member name as is, without any modifications.
IsFulltextFieldOnly Gets or sets a method that determines if the given property or field of type string is a full-text field only, i.e. it is not available as a string attribute in the index. The default always returns false.
IsIdMember Gets or sets a method that determines if the given property or field of a type represents the document id. The default looks for a member named Id.
SaveEnumsAsIntegers Gets or sets a value that indicates whether enums should be persisted as integers. Default is true.
SerializeTypeAsJson Gets or sets a method that determines if the given type should be serialized to JSON. The default is to serialize types to JSON if they can't be stored in any other Sphinx attribute type.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also