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

Placeholder for validation error messages #137

Merged
merged 3 commits into from
Jan 17, 2020
Merged

Placeholder for validation error messages #137

merged 3 commits into from
Jan 17, 2020

Conversation

runceel
Copy link
Owner

@runceel runceel commented Jan 17, 2020

This PR is for issue #136 .

Current behavior

class Foo
{
  [Required(ErrorMessage = "{0} is required.")]
  [Display(Name = "SomeProperty")]
  public ReactiveProperty<string> Name { get; }
  public Foo()
  {
    Name = new ReactiveProperty<string>()
      .SetValidateAttribute(() => Name);
  }
}

var f = new Foo();
var errorMessage = f.GetErrors("Name").Cast<string>().FirstOrdefault(); // Value is required.

Expected behavior

The error message should be "SomeProperty is required."

And if DisplayAttribute is not there, then "Name is required."

@runceel runceel self-assigned this Jan 17, 2020
@runceel runceel marked this pull request as ready for review January 17, 2020 01:15
@runceel runceel merged commit d3a463f into master Jan 17, 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

Successfully merging this pull request may close these issues.

1 participant