Exemple #1
0
        /// <inheritdoc/>
        public virtual ICriteria GetTypeExistsCriteria(Type docType)
        {
            Argument.EnsureNotNull("docType", docType);

            // Without any other guidance, we look for the first non-nullable property.
            var prefix    = GetDocumentMappingPrefix(docType);
            var fieldName = GetFieldName(prefix, MappingHelpers.GetSelectionProperty(docType));

            return(new ExistsCriteria(fieldName));
        }
        /// <inheritdoc/>
        public override ICriteria GetTypeSelectionCriteria(Type type)
        {
            var property = MappingHelpers.GetTypeSelectionProperty(type);

            if (property == null)
            {
                throw new InvalidOperationException(string.Format(TypeCriteriaMissingExceptionMessage, type.Name));
            }

            return(new ExistsCriteria(GetFieldName(type, property)));
        }
Exemple #3
0
        /// <inheritdoc/>
        public override ICriteria GetTypeSelectionCriteria(Type docType)
        {
            var property = MappingHelpers.GetTypeSelectionProperty(docType);

            if (property == null)
            {
                throw new InvalidOperationException(String.Format(TypeCriteriaMissingExceptionMessage, docType.Name));
            }

            var prefix = GetDocumentMappingPrefix(docType);

            return(new ExistsCriteria(GetFieldName(prefix, property)));
        }