Esempio n. 1
0
                bool IEnumerator.MoveNext()
                {
                    IExtensibleEntity deletedEntity;

                    if (_context == null)
                    {
                        return(false);
                    }
                    do
                    {
                        _current = null;
                        if (!this._reader.Read())
                        {
                            _context = null;
                            return(false);
                        }
                        this._current = EntityMaterializer.CreateObject(typeof(T), _reader, _context, _skipDeletedItems, out deletedEntity);
                    }while (deletedEntity != null && _skipDeletedItems);
                    return(true);
                }
Esempio n. 2
0
        private IEnumerable <T> GetResults()
        {
            IEnumerable <T> enumerable = null;
            DbDataReader    reader     = ExecuteReader();

            try
            {
                enumerable = EntityMaterializer.CreateObjects <T>(reader, _context);
            }
            catch (InvalidCastException)
            {
                reader.Dispose();
                throw;
            }
            catch (NotSupportedException)
            {
                reader.Dispose();
                throw;
            }
            return(enumerable);
        }