Example #1
0
 public static void Update <T>(this IDbConnection cnn, string tableName, T item, IDbTransaction transaction = null) where T : IIdentifiable
 {
     cnn.Execute(DynamicQuery.GetUpdateQuery(tableName, item), item, transaction);
 }
Example #2
0
        public static T Insert <T>(this IDbConnection cnn, string tableName, T item, IDbTransaction transaction = null) where T : IIdentifiable
        {
            IEnumerable <T> result = cnn.Query <T>(DynamicQuery.GetInsertQuery(tableName, item), item, transaction);

            return(result.First());
        }