I've been nesting my viewdata classes inside my controllers and, as their numbers grow, I'm starting to ask myself if this is a good idea. Then again, something about polluting the /Views and /Controllers directories with these things seems off.
Is there a convention I'm missing here? Maybe a /ViewData directory? idk, what are some good locations for my viewdata classes?
I don't know of a convention. I just put mine under /Model/ViewModel/BlahViewModel.cs
, etc. I wouldn't put them in a separate project until there was a specific need for that. It wouldn't be difficult to move them later on if needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With