@@ -23,7 +23,7 @@ public static IStatement PrepareInsertOrReplaceStatement<T>(this IDatabaseConnec
2323 {
2424 Contract . Requires ( This != null ) ;
2525
26- var sql = insertOrReplaceQueries . GetValue ( TableMapping . Create < T > ( ) , mapping =>
26+ var sql = insertOrReplaceQueries . GetValue ( TableMapping . Get < T > ( ) , mapping =>
2727 {
2828 var column = mapping . PrimaryKeyColumn ( ) ;
2929 return SQLBuilder . InsertOrReplace ( mapping . TableName , mapping . Columns . Select ( x => x . Key ) ) ;
@@ -32,19 +32,19 @@ public static IStatement PrepareInsertOrReplaceStatement<T>(this IDatabaseConnec
3232 return This . PrepareStatement ( sql ) ;
3333 }
3434
35- private static IEnumerable < KeyValuePair < TInserted , TResult > > YieldInsertOrReplaceAll < TInserted , TResult > (
35+ private static IEnumerable < KeyValuePair < T , T > > YieldInsertOrReplaceAll < T > (
3636 this IDatabaseConnection This ,
37- IEnumerable < TInserted > objects ,
38- Func < IReadOnlyList < IResultSetValue > , TResult > resultSelector )
37+ IEnumerable < T > objects ,
38+ Func < IReadOnlyList < IResultSetValue > , T > resultSelector )
3939 {
40- using ( var insertOrReplaceStmt = This . PrepareInsertOrReplaceStatement < TInserted > ( ) )
41- using ( var findStmt = This . PrepareFindByRowId ( TableMapping . Create < TInserted > ( ) . TableName ) )
40+ using ( var insertOrReplaceStmt = This . PrepareInsertOrReplaceStatement < T > ( ) )
41+ using ( var findStmt = This . PrepareFindByRowId ( TableMapping . Get < T > ( ) . TableName ) )
4242 {
4343 foreach ( var obj in objects )
4444 {
4545 insertOrReplaceStmt . ExecuteWithProperties ( obj ) ;
4646 var rowId = This . LastInsertedRowId ;
47- yield return new KeyValuePair < TInserted , TResult > ( obj , findStmt . Query ( rowId ) . Select ( resultSelector ) . First ( ) ) ;
47+ yield return new KeyValuePair < T , T > ( obj , findStmt . Query ( rowId ) . Select ( resultSelector ) . First ( ) ) ;
4848 }
4949 }
5050 }
@@ -57,16 +57,16 @@ private static IEnumerable<KeyValuePair<TInserted, TResult>> YieldInsertOrReplac
5757 /// <param name="tableMapping">The table mapping.</param>
5858 /// <param name="obj">The object to insert.</param>
5959 /// <typeparam name="T">The mapped type.</typeparam>
60- public static TResult InsertOrReplace < TInserted , TResult > (
60+ public static T InsertOrReplace < T > (
6161 this IDatabaseConnection This ,
62- TInserted obj ,
63- Func < IReadOnlyList < IResultSetValue > , TResult > resultSelector )
62+ T obj ,
63+ Func < IReadOnlyList < IResultSetValue > , T > resultSelector )
6464 {
6565 Contract . Requires ( This != null ) ;
6666 Contract . Requires ( obj != null ) ;
6767 Contract . Requires ( resultSelector != null ) ;
6868
69- return This . YieldInsertOrReplaceAll ( new TInserted [ ] { obj } , resultSelector ) . First ( ) . Value ;
69+ return This . YieldInsertOrReplaceAll ( new T [ ] { obj } , resultSelector ) . First ( ) . Value ;
7070 }
7171
7272 /// <summary>
@@ -77,10 +77,10 @@ public static TResult InsertOrReplace<TInserted, TResult>(
7777 /// <param name="tableMapping">The table mapping.</param>
7878 /// <param name="objects">The objects to be inserted into the database.</param>
7979 /// <typeparam name="T">The mapped type.</typeparam>
80- public static IReadOnlyDictionary < TInserted , TResult > InsertOrReplaceAll < TInserted , TResult > (
80+ public static IReadOnlyDictionary < T , T > InsertOrReplaceAll < T > (
8181 this IDatabaseConnection This ,
82- IEnumerable < TInserted > objects ,
83- Func < IReadOnlyList < IResultSetValue > , TResult > resultSelector )
82+ IEnumerable < T > objects ,
83+ Func < IReadOnlyList < IResultSetValue > , T > resultSelector )
8484 {
8585 Contract . Requires ( This != null ) ;
8686 Contract . Requires ( objects != null ) ;
@@ -103,10 +103,10 @@ public static partial class AsyncDatabaseConnection
103103 /// <param name="objects">The objects to be inserted into the database.</param>
104104 /// <param name="ct">A cancellation token that can be used to cancel the operation</param>
105105 /// <typeparam name="T">The mapped type.</typeparam>
106- public static Task < IReadOnlyDictionary < TInserted , TResult > > InsertOrReplaceAllAsync < TInserted , TResult > (
106+ public static Task < IReadOnlyDictionary < T , T > > InsertOrReplaceAllAsync < T > (
107107 this IAsyncDatabaseConnection This ,
108- IEnumerable < TInserted > objects ,
109- Func < IReadOnlyList < IResultSetValue > , TResult > resultSelector ,
108+ IEnumerable < T > objects ,
109+ Func < IReadOnlyList < IResultSetValue > , T > resultSelector ,
110110 CancellationToken ct )
111111 {
112112 Contract . Requires ( This != null ) ;
@@ -124,10 +124,10 @@ public static Task<IReadOnlyDictionary<TInserted, TResult>> InsertOrReplaceAllAs
124124 /// <param name="tableMapping">The table mapping.</param>
125125 /// <param name="objects">The objects to be inserted into the database.</param>
126126 /// <typeparam name="T">The mapped type.</typeparam>
127- public static Task < IReadOnlyDictionary < TInserted , TResult > > InsertOrReplaceAllAsync < TInserted , TResult > (
127+ public static Task < IReadOnlyDictionary < T , T > > InsertOrReplaceAllAsync < T > (
128128 this IAsyncDatabaseConnection This ,
129- IEnumerable < TInserted > objects ,
130- Func < IReadOnlyList < IResultSetValue > , TResult > resultSelector )
129+ IEnumerable < T > objects ,
130+ Func < IReadOnlyList < IResultSetValue > , T > resultSelector )
131131 {
132132 Contract . Requires ( This != null ) ;
133133 Contract . Requires ( objects != null ) ;
0 commit comments