Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Idea for integration

$
0
0
This is something I'd really like to see as well. If you're using migrations, you pretty much have to use EntityTypeConfiguration's fluent api heavily to guide the migrations, otherwise you end up editing the migrations directly (which is problematic) to get the details in.

The fact that you have to duplicate this effort for validation feels incredibly dirty to me. The EntityTypeConfiguration classes will contain 90% or more of the validation required by your model, why not keep everything dry and build directly on top of them?

I use ViewModels extensively, but I still reference my model classes frequently within my ViewModels, making them complex types. If I can have my model validations covered without having to duplicate the rules, that would be wonderful.

I haven't figured out the best way to do this yet, however. If there's generation involved, we'd have to make sure the generated files were in lockstep with the EntityTypeConfiguration files and their changes, creating maintenance issues. If there's no generation involved, performance is always a concern. If you have any strategies in mind, please share and we can collaborate.

Tim

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>