Fix EntityStorage parameter binding
This commit is contained in:
parent
339dc635e5
commit
ccd824dcc3
@ -152,7 +152,11 @@ internal class EntityStorage<TEntity> : IAsyncEnumerable<TEntity>, IStorage<TEnt
|
||||
|
||||
await Execute(new StorageContextArgs(operation));
|
||||
|
||||
return entity;
|
||||
var clone = entity.Clone();
|
||||
|
||||
ReturnValueBinder.Bind(operation, clone);
|
||||
|
||||
return clone;
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs the update on the specified entity with optional concurrency callback support.
|
||||
@ -274,7 +278,7 @@ internal class EntityStorage<TEntity> : IAsyncEnumerable<TEntity>, IStorage<TEnt
|
||||
/*
|
||||
* Bind storage parameters with operation parameters.
|
||||
*/
|
||||
ReturnValueBinder.Bind(writer, args.Operation);
|
||||
ReturnValueBinder.Bind(writer.Operation, args.Operation);
|
||||
|
||||
return recordsAffected;
|
||||
}
|
||||
|
@ -8,14 +8,11 @@ namespace Connected.Data.Storage
|
||||
{
|
||||
internal static class ReturnValueBinder
|
||||
{
|
||||
public static void Bind(IStorageWriter w, IStorageOperation operation)
|
||||
public static void Bind(IStorageOperation operation, object entity)
|
||||
{
|
||||
List<PropertyInfo> properties = null;
|
||||
|
||||
if (w.Operation.Parameters is null)
|
||||
return;
|
||||
|
||||
foreach (var parameter in w.Operation.Parameters)
|
||||
foreach (var parameter in operation.Parameters)
|
||||
{
|
||||
if (parameter.Direction != ParameterDirection.ReturnValue && parameter.Direction != ParameterDirection.Output)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user