Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit dea89fa

Browse files
committed
Relax generic constrain on UpdateOnly
1 parent 7f6647c commit dea89fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ServiceStack.OrmLite/Expressions/WriteExpressionCommandExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ internal static void UpdateOnlySql<T>(this IDbCommand dbCmd, T model, SqlExpress
3232
dbCmd.CommandText += " " + onlyFields.WhereExpression;
3333
}
3434

35-
internal static int UpdateOnly<T, TKey>(this IDbCommand dbCmd, T obj,
36-
Expression<Func<T, TKey>> onlyFields = null,
35+
internal static int UpdateOnly<T>(this IDbCommand dbCmd, T obj,
36+
Expression<Func<T, object>> onlyFields = null,
3737
Expression<Func<T, bool>> where = null)
3838
{
3939
if (onlyFields == null)

src/ServiceStack.OrmLite/OrmLiteWriteExpressionsApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public static int UpdateOnly<T>(this IDbConnection dbConn,
6161
/// db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName);
6262
/// UPDATE "Person" SET "FirstName" = 'JJ'
6363
/// </summary>
64-
public static int UpdateOnly<T, TKey>(this IDbConnection dbConn, T obj,
65-
Expression<Func<T, TKey>> onlyFields = null,
64+
public static int UpdateOnly<T>(this IDbConnection dbConn, T obj,
65+
Expression<Func<T, object>> onlyFields = null,
6666
Expression<Func<T, bool>> where = null)
6767
{
6868
return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(obj, onlyFields, where));

0 commit comments

Comments
 (0)