I have an application that has an public 'end user' mode and a 'back office' mode. Both 'modes' pretty much share the same controller logic but the user interfaces for these different 'modes' are radically different.
Using the out of box default routing that you get when a project is created for the first time I have something like the following:
Controllers\ HomeController.cs Views BackOffice Index.aspx Public Index.aspx Shared BackOfficeSite.Master PublicSite.Master
In my HomeController.cs
I have logic that looks like this:
public ActionResult Index()
{
var devices = DeviceRepository.FindDevicesByCustomer(100);
if(IsBackOffice())
{
return View(@"~/Views/BackOffice/Index.aspx", devices);
}
return View(@"~/Views/Public/Index.aspx", devices);
}
Is this the correct way to be doing this or am I digging myself an anti-pattern hole?
I'm using ASP.NET MVC 2.