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

How to use FluentValidation 9.+ with this plugin #14

Open
john-dalsgaard opened this issue Jul 27, 2020 · 0 comments
Open

How to use FluentValidation 9.+ with this plugin #14

john-dalsgaard opened this issue Jul 27, 2020 · 0 comments

Comments

@john-dalsgaard
Copy link

john-dalsgaard commented Jul 27, 2020

I've been using your plugin for a while as the best way to do validation in my Xamarin project.

However, with the recent update to FluentValidation 9.0.1 the plugin does not work any more. The FluentValidation.ValidatorAttribute package is not supported on 9.+ and that gives a challenge in the AbstractValidationViewModel method:

        public ValidationResult GetValidationResult()
        {
            var attributeFactory = new AttributedValidatorFactory();
            var type = GetType();
            var validator = attributeFactory.GetValidator(type);
            var results = validator.Validate(this);
            return results;
        }

as the AttributedValidatorFactory doesn’t exist any more. I'm not sure how to work around this?

The migration documentation in FluentValidation suggests using an IoC container instead - but that seems quite another approach to what this plugin does - so I'm not sure how to do this (still a little new on DI though I'm building on Prism using DryIoc).

Hoping to get some suggestions to go with.

Thanks in advance!

@john-dalsgaard john-dalsgaard changed the title How to use FluentValidation 9.+ with this pål How to use FluentValidation 9.+ with this plugin Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant