public T[] GetTransformedDocuments <T>(GetDocumentResult result)
        {
            if (result == null)
            {
                return(null);
            }

            if (typeof(T).IsArray)
            {
                return(TransformerHelpers.ParseResultsArray <T>(_session, result));
            }

            var items = TransformerHelpers.ParseResults <T>(_session, result).ToArray();

            return(items);
        }
        public T[] GetTransformedDocuments <T>(GetDocumentResult result)
        {
            if (result == null)
            {
                return(null);
            }

            if (typeof(T).IsArray)
            {
                return(TransformerHelpers.ParseResultsArray <T>(_session, result));
            }

            var items = TransformerHelpers.ParseResults <T>(_session, result).ToArray();

            if (items.Length > _ids.Length)
            {
                throw new InvalidOperationException(String.Format("A load was attempted with transformer {0}, and more than one item was returned per entity - please use {1}[] as the projection type instead of {1}",
                                                                  _transformer,
                                                                  typeof(T).Name));
            }

            return(items);
        }