File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -508,14 +508,20 @@ directive:
508508 ensureCall = `
509509 if (BodyParameter != null)
510510 {
511- var _ = BodyParameter?.ToJsonString(); // force evaluation
511+ foreach (var prop in BodyParameter.GetType().GetProperties())
512+ {
513+ var val = prop.GetValue(BodyParameter); // force materialization
514+ }
512515 ${nameSpacePrefix}.ModelExtensions.ModelExtensions.EnsurePropertiesAreReady(BodyParameter, failOnExplicitNulls: false).GetAwaiter().GetResult();
513516 }`;
514517 } else if ($.includes('_body')) {
515518 ensureCall = `
516519 if (_body != null)
517520 {
518- var _ = _body?.ToJsonString(); // force evaluation
521+ foreach (var prop in _body.GetType().GetProperties())
522+ {
523+ var val = prop.GetValue(_body); // force materialization
524+ }
519525 ${nameSpacePrefix}.ModelExtensions.ModelExtensions.EnsurePropertiesAreReady(_body, failOnExplicitNulls: false).GetAwaiter().GetResult();
520526 }`;
521527 }
You can’t perform that action at this time.
0 commit comments