Created
November 17, 2012 01:01
-
-
Save valeriob/4092323 to your computer and use it in GitHub Desktop.
OrmLite Insert Update extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class OrmLite_Extensions | |
{ | |
public static void Insert2<T>(this IDbConnection dbConn, params T[] objs) | |
where T : new() | |
{ | |
foreach (var obj in objs) | |
dbConn.Exec(dbCmd => OrmLiteConfig.DialectProvider.CreateParameterizedInsertStatement(obj, dbConn).ExecuteNonQuery() ); | |
} | |
public static void Update2<T>(this IDbConnection dbConn, params T[] objs) | |
where T : new() | |
{ | |
foreach (var obj in objs) | |
dbConn.Exec(dbCmd => OrmLiteConfig.DialectProvider.CreateParameterizedUpdateStatement(obj, dbConn).ExecuteNonQuery() ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment