mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
68 lines
2.3 KiB
C#
68 lines
2.3 KiB
C#
//------------------------------------------------------------------------------
|
|
// <copyright file="NextResultGenerator.cs" company="Microsoft">
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// </copyright>
|
|
// <owner current="true" primary="true">WillA</owner>
|
|
//------------------------------------------------------------------------------
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.Common;
|
|
using System.Data.Common.Utils;
|
|
using System.Data.EntityClient;
|
|
using System.Data.Common.Internal.Materialization;
|
|
using System.Data.Metadata.Edm;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
|
|
namespace System.Data.Objects
|
|
{
|
|
internal class NextResultGenerator
|
|
{
|
|
EntityCommand _entityCommand;
|
|
ReadOnlyMetadataCollection<EntitySet> _entitySets;
|
|
ObjectContext _context;
|
|
EdmType[] _edmTypes;
|
|
int _resultSetIndex;
|
|
MergeOption _mergeOption;
|
|
|
|
internal NextResultGenerator(ObjectContext context, EntityCommand entityCommand, EdmType[] edmTypes, ReadOnlyMetadataCollection<EntitySet> entitySets, MergeOption mergeOption, int resultSetIndex)
|
|
{
|
|
_context = context;
|
|
_entityCommand = entityCommand;
|
|
_entitySets = entitySets;
|
|
_edmTypes = edmTypes;
|
|
_resultSetIndex = resultSetIndex;
|
|
_mergeOption = mergeOption;
|
|
}
|
|
|
|
internal ObjectResult<TElement> GetNextResult<TElement>(DbDataReader storeReader)
|
|
{
|
|
bool isNextResult = false;
|
|
try
|
|
{
|
|
isNextResult = storeReader.NextResult();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
if (EntityUtil.IsCatchableExceptionType(e))
|
|
{
|
|
throw EntityUtil.CommandExecution(System.Data.Entity.Strings.EntityClient_StoreReaderFailed, e);
|
|
}
|
|
throw;
|
|
}
|
|
|
|
if (isNextResult)
|
|
{
|
|
EdmType edmType = _edmTypes[_resultSetIndex];
|
|
MetadataHelper.CheckFunctionImportReturnType<TElement>(edmType, _context.MetadataWorkspace);
|
|
return _context.MaterializedDataRecord<TElement>(_entityCommand, storeReader, _resultSetIndex, _entitySets, _edmTypes, _mergeOption);
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|