{"action":"created","issue":{"url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/62","labels_url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/62/comments","events_url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/62/events","html_url":"https://github.com/JeremySkinner/FluentValidation/issues/62","id":74041032,"number":62,"title":"Help with customizing extensions for .WithName()","user":{"login":"mmiller678","id":3980108,"avatar_url":"https://avatars.githubusercontent.com/u/3980108?v=3","gravatar_id":"","url":"https://api.github.com/users/mmiller678","html_url":"https://github.com/mmiller678","followers_url":"https://api.github.com/users/mmiller678/followers","following_url":"https://api.github.com/users/mmiller678/following{/other_user}","gists_url":"https://api.github.com/users/mmiller678/gists{/gist_id}","starred_url":"https://api.github.com/users/mmiller678/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmiller678/subscriptions","organizations_url":"https://api.github.com/users/mmiller678/orgs","repos_url":"https://api.github.com/users/mmiller678/repos","events_url":"https://api.github.com/users/mmiller678/events{/privacy}","received_events_url":"https://api.github.com/users/mmiller678/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-07T16:13:00Z","updated_at":"2015-05-15T14:15:53Z","closed_at":null,"body":"Looking to do something similar to what is described here, but with Name rather than Message\r\nhttp://fluentvalidation.codeplex.com/discussions/440136\r\n\r\nDoes it make sense to modify PropertyRule to have another property similar to how MessageBuilder works.  That would allow me to do something like:\r\n\r\nRuleFor(x => x.City)\r\n.NotEmpty()\r\n.WithName(x => x.DisplayPrefix + \" City\");\r\n\r\nThat way I could have 2 models of the same type generate different error messages in the same validation context.\r\n\r\nDeparture City should not be empty\r\nArrival City should not be empty\r\n\r\nA simplified model would look something like this:\r\n\r\npublic class SearchModel\r\n{\r\npublic SearchLocationModel DepartureLocation {get;set;}\r\npublic SearchLocationModel ArrivalLocation {get;set;}\r\n}\r\n\r\npublic class SearchLocationModel\r\n{\r\npublic string DisplayPrefix {get;set;}\r\npublic string City {get;set;}\r\n}\r\n\r\nOr perhaps there is a better way to accomplish this?\r\n"},"comment":{"url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/comments/102410945","html_url":"https://github.com/JeremySkinner/FluentValidation/issues/62#issuecomment-102410945","issue_url":"https://api.github.com/repos/JeremySkinner/FluentValidation/issues/62","id":102410945,"user":{"login":"mmiller678","id":3980108,"avatar_url":"https://avatars.githubusercontent.com/u/3980108?v=3","gravatar_id":"","url":"https://api.github.com/users/mmiller678","html_url":"https://github.com/mmiller678","followers_url":"https://api.github.com/users/mmiller678/followers","following_url":"https://api.github.com/users/mmiller678/following{/other_user}","gists_url":"https://api.github.com/users/mmiller678/gists{/gist_id}","starred_url":"https://api.github.com/users/mmiller678/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmiller678/subscriptions","organizations_url":"https://api.github.com/users/mmiller678/orgs","repos_url":"https://api.github.com/users/mmiller678/repos","events_url":"https://api.github.com/users/mmiller678/events{/privacy}","received_events_url":"https://api.github.com/users/mmiller678/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T14:15:53Z","updated_at":"2015-05-15T14:15:53Z","body":"That makes sense - just our curiosity how does message work for MVC client side validation as I assume the same issue applies there?  I will look at it a bit more and see what I can come up with."}}