DEV Community

Discussion on: Where Do I Put My Business Rules And Validation?

 
jamesmh profile image
James Hickey

Thanks! I've seen people do that too.

There's always the discussion as to how much should be validated using ModelState in .NET etc. too.

I find it helpful, all things equal, to have the bulk of non-trivial validation located in the same place (inside the business logic - wherever that may be).

I've worked on a system that had to validate ALL business rules client-side, then in the app layer, and finally in the DB (stored procs).

So like the exact same business rules re-done in JS, C# and then TSQL. Really weird. But that's what they wanted!

I did learn about all 3 languages really quick 😂