Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use consistent binding logic for nested properties in object argument values #430

Merged
merged 3 commits into from
Aug 18, 2024

Conversation

nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Aug 3, 2024

Fixes #417

When an argument value is a complex object, instead of deferring to Microsoft.Extensions.Configuration we'll now recursively use the same logic to construct its properties that we do when constructing the object itself. This means that values accepted for constructor parameters and method arguments now line up with those accepted for property setters.

This should allow for some simplification of the rest of ObjectArgumentValue once we've shaken out any issues.

Thanks for your patience and effort narrowing this down, @MrPsi - sorry it took a while to get back around to it! I think the limitation here is the one to fix, so if/when this is merged I think it will supersede serilog/serilog-sinks-email#131.

}

[Fact]
public void ConstructsNestedComplexObjects()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant test case is this one :-)

@MrPsi
Copy link

MrPsi commented Aug 12, 2024

Thanks @nblumhardt,

I have tested your PR on my case and it seems to work great. Hopefully it will be included in the next release :)

@nblumhardt
Copy link
Member Author

Great! Thanks for the feedback @MrPsi. I'll leave this open a few more days in case there's some feedback to come, but should get a dev build out soon.

@nblumhardt nblumhardt merged commit 428ab69 into serilog:dev Aug 18, 2024
1 check passed
@ArieGato
Copy link

ArieGato commented Oct 5, 2024

Hi @nblumhardt, do you have any indicatation when the next release will be containing this merge?

@nblumhardt nblumhardt mentioned this pull request Oct 7, 2024
@nblumhardt
Copy link
Member Author

8.0.3 is out now; thanks @ArieGato 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not able to specify complex parameter
3 participants