From d92f0a6f82e91b895200bd25984017630d69dbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Tue, 24 Jan 2023 17:13:27 +0100 Subject: [PATCH] Fix CommandBuilder not appending output parameters on cached command --- src/Connected.Data/Update/CommandBuilder.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Connected.Data/Update/CommandBuilder.cs b/src/Connected.Data/Update/CommandBuilder.cs index 69ce790..d2742e4 100644 --- a/src/Connected.Data/Update/CommandBuilder.cs +++ b/src/Connected.Data/Update/CommandBuilder.cs @@ -47,18 +47,19 @@ internal abstract class CommandBuilder foreach (var parameter in existing.Parameters) { - if (parameter.Direction == ParameterDirection.Input) + if (ResolveProperty(parameter.Name) is PropertyInfo property) { - if (ResolveProperty(parameter.Name) is PropertyInfo property) + result.AddParameter(new StorageParameter { - result.AddParameter(new StorageParameter + Value = parameter.Direction switch { - Value = GetValue(property), - Name = parameter.Name, - Type = parameter.Type, - Direction = parameter.Direction - }); - } + ParameterDirection.Input => GetValue(property), + _ => default + }, + Name = parameter.Name, + Type = parameter.Type, + Direction = parameter.Direction + }); } }