Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Auto validation with custom model binder #11

Closed
cris770 opened this issue Sep 26, 2023 · 3 comments · Fixed by #14
Closed

Auto validation with custom model binder #11

cris770 opened this issue Sep 26, 2023 · 3 comments · Fixed by #14
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cris770
Copy link

cris770 commented Sep 26, 2023

Hi,

I am trying to use auto request validation in an app that uses a custom model binder.
Looking at the code here , I see the accepted binding sources are Query, Form and Body. Would it be possible to extend that to allow custom binding sources as well?

Thank you!

@mvdgun
Copy link
Member

mvdgun commented Sep 26, 2023

Hi there! I haven't used custom binding source yet. Could you post some code to help me understand how the binding works? I do see a BindingSource.Custom option in the .NET framework so I guess we can make it work.

@mvdgun mvdgun self-assigned this Sep 26, 2023
@mvdgun mvdgun added this to the v1.3 milestone Sep 26, 2023
@mvdgun mvdgun added the enhancement New feature or request label Oct 1, 2023
@jonmotos
Copy link
Contributor

jonmotos commented Oct 2, 2023

I actually have a PR I'm hoping to submit today with this exact feature, as I had a need for it. @mvdgun, is it worth me submitting that or have you started implementation?

@cris770
Copy link
Author

cris770 commented Oct 2, 2023

@JonAdamsFromNC I am happy you have a PR for this.
I was trying to use a variation of FromHybrid model binding, but apart from the auto validation issues I had a few other problems that made me decide to go back to the default model binding.
But I do think adding support for custom binders will be a nice feature for this great library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants