Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 718d46e

Browse files
committed
Fix extra boxing allocation on Update methods.
1 parent f604336 commit 718d46e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎DataCore.Database/Database.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void Insert<T>(T obj)
5858
Execute(query, parameters);
5959
}
6060

61-
public void Update<T>(T obj, Expression<Func<T, dynamic>> whereClause)
61+
public void Update<T>(T obj, Expression<Func<T, bool>> whereClause)
6262
{
6363
var type = typeof(T);
6464

@@ -87,7 +87,7 @@ public void Update<T>(T obj, Expression<Func<T, dynamic>> whereClause)
8787
}
8888

8989
public void UpdateOnly<T>(T obj, Expression<Func<T, dynamic>> onlyFields,
90-
Expression<Func<T, dynamic>> whereClause)
90+
Expression<Func<T, bool>> whereClause)
9191
{
9292
var type = typeof(T);
9393

‎DataCore.Database/IDatabase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public interface IDatabase : IDisposable
6464

6565
void Insert<T>(T obj);
6666

67-
void Update<T>(T obj, Expression<Func<T, dynamic>> whereClause);
68-
void UpdateOnly<T>(T obj, Expression<Func<T, dynamic>> onlyFields, Expression<Func<T, dynamic>> whereClause);
67+
void Update<T>(T obj, Expression<Func<T, bool>> whereClause);
68+
void UpdateOnly<T>(T obj, Expression<Func<T, dynamic>> onlyFields, Expression<Func<T, bool>> whereClause);
6969

7070
void Delete<T>(Expression<Func<T, bool>> whereClause);
7171
void DeleteById<T>(object id);

0 commit comments

Comments
 (0)