Why does T4MVC generate controller default constructor? Just curious.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This thread has some discussion on this. In short, I had attempted to remove it, but it didn’t’ achieve that much so I didn’t make the change. But for most people, this is a non-issue. Hopefully, that is the case for you as well, since you say you’re ‘just curious’ 🙂
As for why it needs a default ctor, it has to do with the way T4MVC generates derived controller classes that it needs to be able to instantiate. For this to work, it needs to be able to properly construct the base class, which is not easy when it doesn’t have a default ctor.