/// <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 = ReflectionUtil.GetPropertiesAndFieldsFor <TProjection>(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).ToList(); var projections = propertyInfos.Select(x => x.Name).ToArray(); var identityProperty = DocumentConvention.GetIdentityProperty(typeof(TProjection)); var fields = propertyInfos.Select(p => (p == identityProperty) ? Constants.Indexing.Fields.DocumentIdFieldName : p.Name).ToArray(); return(SelectFields <TProjection>(fields, projections)); }
private MemberInfo GetIdentityProperty(Type entityType) { return(conventions.GetIdentityProperty(entityType)); }