public ActionResult Index() { var model = new BreadcrumbsIndexViewModel() { Matches = new Dictionary<string, PatternMatch>(), Patterns = _breadcrumbs.GetPatterns(), Providers = _breadcrumbs.GetProviderDescriptors() }; return View(model); }
public ActionResult IndexPOST(BreadcrumbsIndexViewModel model) { model.Patterns = _breadcrumbs.GetPatterns(); model.Providers = _breadcrumbs.GetProviderDescriptors(); foreach (var pattern in model.Patterns) { PatternMatch match; _patterns.TryMatch(model.TestString, pattern.Pattern, out match); model.Matches[pattern.Pattern] = match; } return View(model); }