Example #1
0
        /// <summary>
        /// Selects the projection fields directly from the index
        /// </summary>
        /// <typeparam name="TProjection">The type of the projection.</typeparam>
        public IDocumentQuery <TProjection> SelectFields <TProjection>()
        {
            var propertyInfos = typeof(TProjection).GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            var projections   = propertyInfos.Select(x => x.Name).ToArray();
            var fields        = propertyInfos.Select(x => DocumentConvention.FindIdentityProperty(x) ? Constants.DocumentIdFieldName : x.Name).ToArray();

            return(SelectFields <TProjection>(fields, projections));
        }