コード例 #1
0
        private EffectiveRolesEditModel BuildViewModel(EffectiveRolesPart part)
        {
            var hasRoles = part.ListEffectiveRoles();
            var allRoles = _roleService.GetRoles().OrderBy(r => r.Name).Select(r => new SelectListItem()
            {
                Selected = hasRoles.Contains(r.Name), Text = r.Name, Value = r.Name
            });
            var model = new EffectiveRolesEditModel()
            {
                AllRoles = allRoles
            };

            return(model);
        }
コード例 #2
0
 private DriverResult EditorShape(EffectiveRolesEditModel model, dynamic shapeHelper)
 {
     return(ContentShape("Parts_EffectiveRoles_Edit",
                         () => shapeHelper.EditorTemplate(TemplateName: TemplateName + ".Edit", Model: model, Prefix: Prefix)));
 }