Base solution for your next web application

Activities of "hubert"

I guess you have to add the mapping to fluent NH configuration. In the project Xxx.NHibernate please see the code of XxxDataModule:

Configuration.DefaultNameOrConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
            Configuration.Modules.AbpNHibernate().FluentConfiguration
                .Database(MsSqlConfiguration.MsSql2008.ConnectionString(Configuration.DefaultNameOrConnectionString))
                .Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));

All you need to do is add mapping line pointing to referenced Zero.NHibernate

Hikalkan, Thank you for the framework, and for forcing me to read more in this topic :) Your point of view is "MS way" (like described here: <a class="postlink" href="https://msdn.microsoft.com/en-us/library/ff649585.aspx">https://msdn.microsoft.com/en-us/library/ff649585.aspx</a>), mine is more "pragmatic". For me object is valid or not - only two states. The "Simple Validation" is some gray between black and white. Even if the validation method returns true, you can never be sure if the object is truly valid. Even simpliest models need some more sophisticated validation (like name uniqueness etc.), so almost always validation logic has to be splitted into "simple" and "advanced", without clear border which one is which. For me it's a mess not benefit. Are you sure, it's good design choice?

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 3 of 3 entries