コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }