public static string Show <TShowModel>(this UrlHelper helper,
                                               TShowModel showModel) where TShowModel : class
        {
            var routeValues = ModelRouteValuesProvider.GetRouteValues(showModel);

            return(Action(helper,
                          ActionNames.Show,
                          showModel,
                          routeValues));
        }
        public static string Edit <TEditModel>(this UrlHelper helper,
                                               TEditModel editModel) where TEditModel : class
        {
            var routeValues = ModelRouteValuesProvider.GetRouteValues(editModel);

            return(Action(helper,
                          ActionNames.Edit,
                          editModel,
                          routeValues));
        }
        public static MvcForm BeginEditForm <TEditModel>(this HtmlHelper helper,
                                                         TEditModel editModel,
                                                         FormMethod method,
                                                         object htmlAttributes = null) where TEditModel : class
        {
            var routeValues    = ModelRouteValuesProvider.GetRouteValues(editModel);
            var controllerName = HelperUtil.GetControllerName(editModel);

            return(helper.BeginForm(ActionNames.Edit,
                                    controllerName,
                                    routeValues,
                                    method,
                                    htmlAttributes));
        }
        public static MvcHtmlString ShowLink <TShowModel>(this HtmlHelper helper,
                                                          TShowModel showModel,
                                                          string linkText,
                                                          object htmlAttributes = null) where TShowModel : class
        {
            var routeValues = ModelRouteValuesProvider.GetRouteValues(showModel);

            return(ActionLink(helper,
                              linkText,
                              ActionNames.Show,
                              showModel,
                              routeValues,
                              htmlAttributes));
        }
        public static MvcHtmlString EditLink <TEditModel>(this HtmlHelper helper,
                                                          TEditModel editModel,
                                                          string linkText,
                                                          object htmlAttributes = null) where TEditModel : class
        {
            var routeValues = ModelRouteValuesProvider.GetRouteValues(editModel);

            return(ActionLink(helper,
                              linkText,
                              ActionNames.Edit,
                              editModel,
                              routeValues,
                              htmlAttributes));
        }