{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/issues/1381","repository_url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate","labels_url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/issues/1381/labels{/name}","comments_url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/issues/1381/comments","events_url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/issues/1381/events","html_url":"https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1381","id":177782944,"number":1381,"title":"ICustomValidate should provide IocManager to resolve dependencies on validation","user":{"login":"hikalkan","id":1210527,"avatar_url":"https://avatars.githubusercontent.com/u/1210527?v=3","gravatar_id":"","url":"https://api.github.com/users/hikalkan","html_url":"https://github.com/hikalkan","followers_url":"https://api.github.com/users/hikalkan/followers","following_url":"https://api.github.com/users/hikalkan/following{/other_user}","gists_url":"https://api.github.com/users/hikalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/hikalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikalkan/subscriptions","organizations_url":"https://api.github.com/users/hikalkan/orgs","repos_url":"https://api.github.com/users/hikalkan/repos","events_url":"https://api.github.com/users/hikalkan/events{/privacy}","received_events_url":"https://api.github.com/users/hikalkan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/labels/breaking%20change","name":"breaking change","color":"fbca04"},{"url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/labels/enhancement","name":"enhancement","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/milestones/67","html_url":"https://github.com/aspnetboilerplate/aspnetboilerplate/milestones/v0.13.0","labels_url":"https://api.github.com/repos/aspnetboilerplate/aspnetboilerplate/milestones/67/labels","id":1993809,"number":67,"title":"v0.13.0","description":"","creator":{"login":"hikalkan","id":1210527,"avatar_url":"https://avatars.githubusercontent.com/u/1210527?v=3","gravatar_id":"","url":"https://api.github.com/users/hikalkan","html_url":"https://github.com/hikalkan","followers_url":"https://api.github.com/users/hikalkan/followers","following_url":"https://api.github.com/users/hikalkan/following{/other_user}","gists_url":"https://api.github.com/users/hikalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/hikalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikalkan/subscriptions","organizations_url":"https://api.github.com/users/hikalkan/orgs","repos_url":"https://api.github.com/users/hikalkan/repos","events_url":"https://api.github.com/users/hikalkan/events{/privacy}","received_events_url":"https://api.github.com/users/hikalkan/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":18,"state":"open","created_at":"2016-09-09T15:59:34Z","updated_at":"2016-09-19T13:21:59Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-09-19T13:21:59Z","updated_at":"2016-09-19T13:21:59Z","closed_at":null,"body":"Thus, we can resolve any depended service and use in custom validation.\r\n\r\nThis is a breaking change but very easy to fix.\r\n\r\n````C#\r\n//old method:\r\npublic void AddValidationErrors(List<ValidationResult> results)\r\n{\r\n    use results...\r\n}\r\n\r\n//new method:\r\npublic void AddValidationErrors(CustomValidatationContext context)\r\n{\r\n    use context.Results...\r\n}\r\n````\r\n\r\nSo, just use ``context.Results`` instead of ``results``.\r\n\r\nBTW, I think that resolving dependencies in a DTO is not a good practice, since it adds a second responsibility to the DTO and makes it coupled to your (probably) business objects.\r\nYou can cay same for attribute validations, but I think it's a 'formal' validation rather than 'business' validation and can be acceptable.\r\nAnyway, many people asked me to add this, and I decided to add it, because we like rapid application developers too :)"}}
{"actor":{"display_login":"hikalkan"}}