本文整理汇总了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>();
}
示例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;
}
示例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>();
}
示例5: MapPlayersInGame
private void MapPlayersInGame(IDbCommand dbCmd, PickUpGame game)
{
game.PlayersIds =
dbCmd.Select<PlayerInGameLink>(x => x.GameId == game.Id).Select(x => x.PlayerId).ToList();
}
示例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();
}