本文整理汇总了C#中IDbConnectionFactory.Exec方法的典型用法代码示例。如果您正苦于以下问题:C# IDbConnectionFactory.Exec方法的具体用法?C# IDbConnectionFactory.Exec怎么用?C# IDbConnectionFactory.Exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDbConnectionFactory
的用法示例。
在下文中一共展示了IDbConnectionFactory.Exec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetByCountryId
public static List<City> GetByCountryId(this City request,
IDbConnectionFactory DbFactory){
return DbFactory.Exec(dbCmd=> dbCmd.Select<City>
(q=> q.CountryId ==request.CountryId )).
OrderBy( q=> q.Name).ToList();
}
示例2: GetByJobCityId
public static List<Person> GetByJobCityId(this Person request,
IDbConnectionFactory DbFactory){
return DbFactory.Exec(dbCmd=> dbCmd.Select<Person>
(q=> q.JobCityId ==request.JobCityId)).
OrderBy( q=> q.Name).ToList();
}
示例3: GetByUserName
public static List<UserAuth> GetByUserName(this UserAuth request,
IDbConnectionFactory DbFactory){
var un= request.UserName;
return DbFactory.Exec(dbCmd=> dbCmd.Select<UserAuth>
(q=> q.UserName.Contains(un))).
OrderBy( q=> q.UserName).ToList();
}
示例4: CreateAppTables
private void CreateAppTables(IDbConnectionFactory dbFactory){
List<Type> tables = new List<Type>( new Type[]{
typeof(Author),
typeof(Country),
typeof(City),
typeof(Company),
typeof(Customer),
typeof(Person)
});
foreach(Type t in tables){
dbFactory.Exec( dbCmd=> dbCmd.CreateTable(false, t) );
}
}
示例5: UpdatePhotoFileName
public static void UpdatePhotoFileName(this Person request,IDbConnectionFactory DbFactory){
SqlExpressionVisitor<Person> ev = OrmLiteConfig.DialectProvider.ExpressionVisitor<Person>();
ev.Where(q=>q.Id==request.Id).Update(f=> f.PhotoFileName);
DbFactory.Exec(dbCmd=> dbCmd.Update<Person>(request, ev));
}