As I am learning MVC 3 it has become apparent that naming is critical to getting the Dbase-Model-Controller-Views to talk together.
Is there an already existing list of naming conventions that should be used in a MVC application?
Something like:
The only major convention is that controller class names must end with "Controller". Any other conventions simply represent best practices and are not required for your application to work.
The table and model naming conventions you mentioned are there because they make the code "read" better (Select * From products where category = 1
; Products.Insert(new Product())
)
MVC automatically looks for a view that matches the name of the action method and it starts looking in a folder that has the same name as the controller. However you can easily trump that by specifying the view name in your view result (return View("MyCustomName")
)
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