Skip to content

Instantly share code, notes, and snippets.

@cbcwebdev
Created August 15, 2011 19:25
Show Gist options
  • Save cbcwebdev/1147521 to your computer and use it in GitHub Desktop.
Save cbcwebdev/1147521 to your computer and use it in GitHub Desktop.
Wizard.cs
public class WizardViewModel
{
public StepOne StepOne
{
get;
set;
}
//
// ... other steps saved for brevity
//
}
public class StepOne
{
[Remote("Tenant", "Validation", "Api", "host", ErrorMessage = "The provided host already exists.")]
public string Host
{
get;
set;
}
//
// ... other properties saved for brevity
//
}
public class ValidationController : Controller
{
private readonly ITenantService _tenantService;
public ValidationController(ITenantService tenantService)
{
_tenantService = tenantService;
}
public ActionResult Tenant(string host)
{
var tenant = _tenantService.FindByHost(host);
return Json(tenant == null, JsonRequestBehavior.AllowGet);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment