In c# defining a class what does : means?
As example, in this very basic controller of an ASP.NET MVC application:
namespace App.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
In the third line, what does : Controller means?
In this case it means that the
HomeControllerinherits theControllerclass.You can read more details about inheritance here, but simply put – inheritance means that everything a
Controlleris, aHomeControlleris also. AHomeControlleris a more finely grainedControllerclass.It can also be used for implementation of interfaces http://msdn.microsoft.com/en-us/library/ms173156.aspx