예제 #1
0
            IEnumerable <T> IMultipleResults.GetResult <T>()
            {
                MetaType rowType = null;
                Func <MetaType, bool> predicate = null;

                if (function != null)
                {
                    foreach (MetaType type2 in function.ResultRowTypes)
                    {
                        if (predicate == null)
                        {
                            predicate = (it => it.Type == typeof(T));
                        }
                        rowType = type2.InheritanceTypes.SingleOrDefault(predicate);
                        if (rowType != null)
                        {
                            break;
                        }
                    }
                }
                if (rowType == null)
                {
                    rowType = provider.services.Model.GetMetaType(typeof(T));
                }
                IObjectReader nextResult = provider.GetDefaultFactory(rowType).GetNextResult(session, false);

                if (nextResult == null)
                {
                    Dispose();
                    return(null);
                }
                return(new SingleResult <T>(new OneTimeEnumerable <T>((IEnumerator <T>)nextResult), executeResult,
                                            provider.services.Context));
            }