当前位置: 首页>>代码示例>>C#>>正文


C# SqlDataReader.NextResultAsync方法代码示例

本文整理汇总了C#中System.Data.SqlClient.SqlDataReader.NextResultAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataReader.NextResultAsync方法的具体用法?C# SqlDataReader.NextResultAsync怎么用?C# SqlDataReader.NextResultAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SqlClient.SqlDataReader的用法示例。


在下文中一共展示了SqlDataReader.NextResultAsync方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapTravelWithGuest

        /// <summary>
        /// Maps the travel with guest.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>List of travel with guests.</returns>
        internal static async Task<List<Guest>> MapTravelWithGuest(SqlDataReader dataReader)
        {
            var persons = new ListResult<Person>();
            var person = new Person();
            var personCollection = new Collection<Person>();

            var guests = new List<Guest>();

            if (dataReader != null)
            {
                ////Map Crew
                ////person.AssignCrewmembers(await MapCrew(dataReader));

                ////Map Crew Personal Detail
                await dataReader.NextResultAsync();
                ////var crewPersonDetailList = await RetrieveCrewmemberPersonalDetail(dataReader);

                ////map access card
                await dataReader.NextResultAsync();

                ////Map Crew Alerts
                await dataReader.NextResultAsync();
                ////var alerts = await AlertsAndMessageMapper.MapAlerts(dataReader);

                await dataReader.NextResultAsync();
                ////var alertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                ////var messages = await AlertsAndMessageMapper.MapMessages(dataReader);

                await dataReader.NextResultAsync();
                ////var messageDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                ////MapCrewDetail(person, crewPersonDetailList, alerts, alertMessages);

                ////Map Visitor
                await dataReader.NextResultAsync();
                ////person.AssignVisitors(await MapVisitors(dataReader));

                ////Map Visitor Personal Detail
                await dataReader.NextResultAsync();
                ////var visitorPersonalDetailList = await RetrieveVisitorPersonalDetail(dataReader);

                ////map access card
                await dataReader.NextResultAsync();

                ////Map Visitor Alerts
                await dataReader.NextResultAsync();
                ////var visitorAlerts = await AlertsAndMessageMapper.MapAlerts(dataReader);

                await dataReader.NextResultAsync();
                ////var visitorAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                ////var visitorMessages = await AlertsAndMessageMapper.MapMessages(dataReader);

                await dataReader.NextResultAsync();
                ////var visitorMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                ////MapVisitorDetail(person, visitorPersonalDetailList, visitorAlerts, visitorAlertMessages);

                ////Map Guest
                await dataReader.NextResultAsync();
                person.AssignGuests(await MapGuests(dataReader));

                ////Map Guest Personal Detail
                await dataReader.NextResultAsync();
                var guestPersonDetailList = await RetrieveGuestPersonalDetail(dataReader);

                ////Map Guest Cruise Detail
                await dataReader.NextResultAsync();
                var guestReservationDetailList = await RetrieveGuestReservationDetail(dataReader);

                ////Map Guest Alerts
                await dataReader.NextResultAsync();
                var guestAlerts = await AlertsAndMessageMapper.MapGuestAlerts(dataReader);

                await dataReader.NextResultAsync();
                var guestAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                var guestMessages = await AlertsAndMessageMapper.MapGuestMessages(dataReader);

                await dataReader.NextResultAsync();
                var guestMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                // Map folio data.
                await dataReader.NextResultAsync();
                var folioList = await RetrieveFolios(dataReader);

                MapGuestDetail(person, guestPersonDetailList, guestReservationDetailList, guestAlerts, guestAlertMessages, guestMessages, guestMessagesDescription, folioList);

                if (!dataReader.IsClosed)
                {
                    dataReader.Close();
//.........这里部分代码省略.........
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:101,代码来源:PersonDataMapper.cs

示例2: MapPerson

        /// <summary>
        /// Maps the person.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Person list</returns>
        internal static async Task<ListResult<Person>> MapPerson(SqlDataReader dataReader)
        {
            var persons = new ListResult<Person>();
            var person = new Person();
            var personCollection = new Collection<Person>();

            if (dataReader != null)
            {
                ////Map Crew
                person.AssignCrewmembers(await MapCrew(dataReader));

                ////Map Crew Personal Detail
                await dataReader.NextResultAsync();
                var crewPersonDetailList = await RetrieveCrewmemberPersonalDetail(dataReader);

                ////map access card
                await dataReader.NextResultAsync();
                var crewAccessCards = await AccessCardMapper.MapCrewAccessCards(dataReader);

                ////Map Crew Alerts
                await dataReader.NextResultAsync();
                var alerts = await AlertsAndMessageMapper.MapCrewAlerts(dataReader);

                await dataReader.NextResultAsync();
                var alertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                var messages = await AlertsAndMessageMapper.MapCrewMessages(dataReader);

                await dataReader.NextResultAsync();
                var messageDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                MapCrewDetail(person, crewPersonDetailList, alerts, alertMessages, messages, messageDescription, crewAccessCards);

                ////Map Visitor
                await dataReader.NextResultAsync();
                person.AssignVisitors(await MapVisitors(dataReader));

                ////Map Visitor Personal Detail
                await dataReader.NextResultAsync();
                var visitorPersonalDetailList = await RetrieveVisitorPersonalDetail(dataReader);

                ////Map Visitor access card
                await dataReader.NextResultAsync();
                var visitorAccessCards = await AccessCardMapper.MapVisitorAccessCards(dataReader);

                ////Map Visitor Alerts
                await dataReader.NextResultAsync();
                var visitorAlerts = await AlertsAndMessageMapper.MapVisitorAlerts(dataReader);

                await dataReader.NextResultAsync();
                var visitorAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                var visitorMessages = await AlertsAndMessageMapper.MapVisitorMessages(dataReader);

                await dataReader.NextResultAsync();
                var visitorMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                MapVisitorDetail(person, visitorPersonalDetailList, visitorAlerts, visitorAlertMessages, visitorMessages, visitorMessagesDescription, visitorAccessCards);

                ////Map Guest
                await dataReader.NextResultAsync();
                person.AssignGuests(await MapGuests(dataReader));

                ////Map Guest Personal Detail
                await dataReader.NextResultAsync();
                var guestPersonDetailList = await RetrieveGuestPersonalDetail(dataReader);

                ////Map Guest Cruise Detail
                await dataReader.NextResultAsync();
                var guestReservationDetailList = await RetrieveGuestReservationDetail(dataReader);

                ////Map Guest Alerts
                await dataReader.NextResultAsync();
                var guestAlerts = await AlertsAndMessageMapper.MapGuestAlerts(dataReader);

                await dataReader.NextResultAsync();
                var guestAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                await dataReader.NextResultAsync();
                var guestMessages = await AlertsAndMessageMapper.MapGuestMessages(dataReader);

                await dataReader.NextResultAsync();
                var guestMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);

                // Map folio data.
                await dataReader.NextResultAsync();
                var folioList = await RetrieveFolios(dataReader);

                MapGuestDetail(person, guestPersonDetailList, guestReservationDetailList, guestAlerts, guestAlertMessages, guestMessages, guestMessagesDescription, folioList);

                ////map total results
                await dataReader.NextResultAsync();
                await MapTotalResults(dataReader, person);
//.........这里部分代码省略.........
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:101,代码来源:PersonDataMapper.cs

示例3: FetchAsync

        /// <summary>
        /// Asynchronously populates instance of SqlResults using rows from SqlDataReader.
        /// </summary>
        /// <param name="reader">SqlDataReader whose rows are to be read.</param>
        /// <returns>A task to await read completion</returns>
        internal async Task FetchAsync(SqlDataReader reader)
        {
            Func<Action, Task> ReadAsync = async (readAction) =>
            {
                while (await reader.ReadAsync())
                {
                    readAction();
                }
            };

            do
            {
                if (reader.FieldCount > 0)
                {
                    SqlResultType resultType = SqlResults.SqlResultTypeFromColumnName(reader.GetSchemaTable().Rows[1]["ColumnName"].ToString());

                    switch (resultType)
                    {
                        case SqlResultType.ShardMap:
                            await ReadAsync(() => _ssm.Add(new SqlShardMap(reader, 1)));
                            break;
                        case SqlResultType.Shard:
                            await ReadAsync(() => _ss.Add(new SqlShard(reader, 1)));
                            break;
                        case SqlResultType.ShardMapping:
                            await ReadAsync(() => _sm.Add(new SqlMapping(reader, 1)));
                            break;
                        case SqlResultType.ShardLocation:
                            await ReadAsync(() => _sl.Add(new SqlLocation(reader, 1)));
                            break;
                        case SqlResultType.SchemaInfo:
                            await ReadAsync(() => _si.Add(new SqlSchemaInfo(reader, 1)));
                            break;
                        case SqlResultType.StoreVersion:
                            await ReadAsync(() => _version = new SqlVersion(reader, 1));
                            break;
                        case SqlResultType.Operation:
                            await ReadAsync(() => _ops.Add(new SqlLogEntry(reader, 1)));
                            break;
                        default:
                            // This code is unreachable, since the all values of the SqlResultType enum are explicitly handled above.
                            Debug.Assert(false);
                            break;
                    }
                }
            }
            while (await reader.NextResultAsync());
        }
开发者ID:xdansmith,项目名称:elastic-db-tools,代码行数:53,代码来源:SqlResults.cs

示例4: MapEmbarkationStatistics

        /// <summary>
        /// Function to map embarkation statistics.
        /// </summary>
        /// <param name="dataReader">Instance of SqlDataReader</param>
        /// <returns>Instance of EmbarkationStatistics</returns>
        internal static async Task<EmbarkationStatistics> MapEmbarkationStatistics(SqlDataReader dataReader)
        {
            var embarkationStatistics = new EmbarkationStatistics();

            if (dataReader != null)
            {
                embarkationStatistics.CurrentBoardingNumber = await MapCurrentBoardingNumber(dataReader);

                await dataReader.NextResultAsync();
                embarkationStatistics.CrewEmbarkation = await MapCrewEmbarkStatistics(dataReader);

                await dataReader.NextResultAsync();
                embarkationStatistics.AssignCountryEmbarkStats(await MapCountryEmbarkStatistics(dataReader));

                await dataReader.NextResultAsync();
                embarkationStatistics.AssignBoardingEmbarkStats(await MapBoardingEmbarkStats(dataReader));

                await dataReader.NextResultAsync();
                embarkationStatistics.GuestEmbarkation = await MapGuestEmbarkStatistics(dataReader);

                await dataReader.NextResultAsync();
                embarkationStatistics.VisitorEmbarkation = await MapVisitorEmbarkStatistics(dataReader);

                if (!dataReader.IsClosed)
                {
                    dataReader.Close();
                }
            }

            return await Task.FromResult(embarkationStatistics);
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:36,代码来源:EmbarkationStatisticsMapper.cs

示例5: MapShipInfo

        /// <summary>
        /// Map ships information.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>ship information</returns>
        internal static async Task<ShipInfo> MapShipInfo(SqlDataReader dataReader)
        {
            var shipInfo = new ShipInfo();
            if (dataReader != null)
            {
                shipInfo.AssignGangwayLocations(await MapGangwayLocations(dataReader));

                await dataReader.NextResultAsync();
                shipInfo.AssignStateroomCategories(await MapStateroomCategories(dataReader));

                await dataReader.NextResultAsync();
                shipInfo.AssignVoyageCollection(await MapVoyages(dataReader));

                await dataReader.NextResultAsync();

                var itineraries = await MapDictionaryAsync(dataReader);
                shipInfo.Voyages.AsParallel().Select(itinerary =>
                {
                    itinerary.MapMasterChildRelations(itineraries, master => master.VoyageId, (master, childs) => master.AssignItineraries(childs));
                    return true;
                }).ToList();
            }

            return shipInfo;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:30,代码来源:ReferenceDataMapper.cs

示例6: MapReferenceData

        /// <summary>
        /// Maps the reference data.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Reference data.</returns>
        internal static async Task<ReferenceData> MapReferenceData(SqlDataReader dataReader)
        {
            var referenceData = new ReferenceData();

            if (dataReader != null)
            {
                referenceData.AssignBrands(await MapBrands(dataReader));

                await dataReader.NextResultAsync();
                var dictionaryPortBrand = await MapBrandPorts(dataReader);
                MapBrandPortIds(referenceData.Brands, dictionaryPortBrand);

                await dataReader.NextResultAsync();
                referenceData.AssignCountries(await MapCountries(dataReader));

                await dataReader.NextResultAsync();
                referenceData.AssignLoyaltyLevelTypes(await MapLoyaltyLevelTypes(dataReader));

                await dataReader.NextResultAsync();
                referenceData.AssignPersonTypes(await MapPersonTypes(dataReader));

                await dataReader.NextResultAsync();
                referenceData.AssignPorts(await MapPorts(dataReader));

                await dataReader.NextResultAsync();
                referenceData.AssignStates(await MapStates(dataReader));

                await dataReader.NextResultAsync();
                referenceData.AssignDocumentTypes(await MapDocumentTypes(dataReader));

                if (!dataReader.IsClosed)
                {
                    dataReader.Close();
                }
            }

            return await Task.FromResult(referenceData);
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:43,代码来源:ReferenceDataMapper.cs


注:本文中的System.Data.SqlClient.SqlDataReader.NextResultAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。