Extending from what Nick has already indicated here is a really stupid example. Note that HomeController inherits from BaseController. SomeResult action will be available in HomeController.
For demo purposes, only here ViewModel:
public class Customer { public string Name { get; set; } public int Age { get; set; } }
Base controller:
public class BaseController : Controller { public ActionResult SomeResult() { var customer = new Customer { Name = "Jon", Age = 15 }; return Json(customer, JsonRequestBehavior.AllowGet); } }
Home controller inheriting from the base controller:
public class HomeController : BaseController { public ActionResult Index() { return View("Index"); } }
Jesse source share