Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should I put my asp.net-mvc strongly typed viewdata?

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?

like image 367
Dane O'Connor Avatar asked Mar 04 '09 21:03

Dane O'Connor


1 Answers

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.

like image 118
John Sheehan Avatar answered Oct 20 '22 22:10

John Sheehan