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


C# IDbCommand.Select方法代码示例

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


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

示例1: Run

        protected override void Run(IDbCommand dbCmd)
        {
            if (this.IsFirstRun)
            {
                dbCmd.CreateTable<SampleOrderLine>(true);
                20.Times(i => dbCmd.Insert(SampleOrderLine.Create(userId, i, 1)));
            }

            var rows = dbCmd.Select<SampleOrderLine>();
        }
开发者ID:EvgeniyProtas,项目名称:servicestack,代码行数:10,代码来源:InsertSampleOrderLineScenario.cs

示例2: Run

		protected override void Run(IDbCommand dbCmd)
		{
			if (this.IsFirstRun)
			{
				dbCmd.CreateTable<ModelWithFieldsOfDifferentTypes>(true);
				20.Times(i => dbCmd.Insert(ModelWithFieldsOfDifferentTypes.Create(i)));
			}

			var rows = dbCmd.Select<ModelWithFieldsOfDifferentTypes>();
		}
开发者ID:nuxleus,项目名称:ServiceStack.OrmLite,代码行数:10,代码来源:InsertModelWithFieldsOfDifferentTypesScenario.cs

示例3: GetUserAuthByUserName

        private static UserAuth GetUserAuthByUserName(IDbCommand dbCmd, string userNameOrEmail)
        {
            var isEmail = userNameOrEmail.Contains("@");
            var userAuth = isEmail
                ? dbCmd.Select<UserAuth>(q => q.Email == userNameOrEmail).FirstOrDefault()
                : dbCmd.Select<UserAuth>(q => q.UserName == userNameOrEmail).FirstOrDefault();

            return userAuth;
        }
开发者ID:rajeshpillai,项目名称:ServiceStack,代码行数:9,代码来源:OrmLiteAuthRepository.cs

示例4: Run

        protected override void Run(IDbCommand dbCmd)
        {
            if (this.IsFirstRun)
            {
                new InsertNorthwindDataScenario().InsertData(dbCmd);
            }

            dbCmd.Select<Category>();
            dbCmd.Select<Customer>();
            dbCmd.Select<Employee>();
            dbCmd.Select<Shipper>();
            dbCmd.Select<Order>();
            dbCmd.Select<Product>();
            dbCmd.Select<OrderDetail>();
            dbCmd.Select<CustomerCustomerDemo>();
            dbCmd.Select<Region>();
            dbCmd.Select<Territory>();
            dbCmd.Select<EmployeeTerritory>();
        }
开发者ID:EvgeniyProtas,项目名称:servicestack,代码行数:19,代码来源:SelectNorthwindDataScenario.cs

示例5: MapPlayersInGame

 private void MapPlayersInGame(IDbCommand dbCmd, PickUpGame game)
 {
     game.PlayersIds =
         dbCmd.Select<PlayerInGameLink>(x => x.GameId == game.Id).Select(x => x.PlayerId).ToList();
 }
开发者ID:simtay111,项目名称:TheRealDeal,代码行数:5,代码来源:PickUpGameRepository.cs

示例6: MapSportsAndLocations

 private void MapSportsAndLocations(Profile profile, IDbCommand dbCmd)
 {
     profile.SportsPlayed = dbCmd.Select<PlayerSportLink>("PlayerId = {0}", profile.ProfileName)
         .Select(x => new SportWithSkillLevel { Name = x.Sport, SkillLevel = new SkillLevel(x.Skill) }).ToList();
     profile.Locations = dbCmd.Select<PlayerLocationLink>("PlayerId = {0}", profile.ProfileName)
         .Select(x => new Location() { Name = x.Location }).ToList();
 }
开发者ID:simtay111,项目名称:TheRealDeal,代码行数:7,代码来源:ProfileRepository.cs


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