public HtmlRole GetHtmlRole(string propertyName) { HtmlRole role = HtmlRoles.Where(s => s.Name.ToLower() == propertyName.ToLower()).FirstOrDefault(); if (role == null) { role = new HtmlRole { Name = propertyName, RoleAccess = RoleAccess.NoAccess }; } return(role); }
public RoleList GetSample() { RoleList roleList = new RoleList(); HtmlRole role1 = new HtmlRole { Name = "key", RoleAccess = RoleAccess.Edit }; HtmlRole role2 = new HtmlRole { Name = "value", RoleAccess = RoleAccess.Edit }; HtmlRole role3 = new HtmlRole { Name = "search", RoleAccess = RoleAccess.Edit }; roleList.HtmlRoles.Add(role1); roleList.HtmlRoles.Add(role2); roleList.HtmlRoles.Add(role3); return(roleList); }