Skip to content

Commit 32490f2

Browse files
author
Alexander
committed
Fixed the Equals method invokationorder
`e.Id.Equals(key)` is the right way to execute the method (because calling a Equals(e.Id, key) will try to cast them to `object`s (and It doesn't work inside that Linq expression) and `System.NotSupportedException` will appear.
1 parent 96c481f commit 32490f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AbpODataDemo.WebApi/Controllers/AbpODataEntityController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public IQueryable<TEntity> Get()
5151
[EnableQuery]
5252
public SingleResult<TEntity> Get([FromODataUri] TPrimaryKey key)
5353
{
54-
var entity = Repository.GetAll().Where(e => Equals(e.Id, key));
54+
var entity = Repository.GetAll().Where(e => e.Id.Equals(key));
5555
return SingleResult.Create(entity);
5656
}
5757

0 commit comments

Comments
 (0)