Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "hubert"

Hi I have db table which doesnot allow duplication of some column (ie. Name has to be unique). It seems, that current validation model can't handle this scenario well. I have created DTO with dependency on IMyRepository, but it hasn't been resolved. For now I decided to force DI using Abp.Dependency.IocManager.Instance.Resolve<IMyRepository>() but I don't like it. My proposition is to remove Validation feature from DTO and move it to external validation class, then inject. This gives a lot more flexibility in validation. Good validator :

  • should be testable
  • should be injectable
  • should not pollute the class with attributes, since it makes class code less readable
  • should be able to validate on server side and - if possible - for MVC
  • should be able to provide/handle multiple validation scenarions for one class - very usefull when checking domain objects, not only DTOs I have used FluentValidation in my previous projects and have to say it works well. I believe it's not a big change - I could try to implement it on my own, but I'd like to know what do you think about it?
Showing 1 to 1 of 1 entries