public JsonNetResult GetRoleOptions() { try { var roles = repo.OrderBy(r => r.Name) .Select(r => new JTableOption { DisplayText = r.Name, Value = r.ID }); if (roles.Count() > 0) { return(JsonNet.JsonOKOptions(roles)); } return(JsonNet.JsonNoOptions(StringFormatters.NotAvailable(Resources.Global.General_Roles.ToLower()))); } catch (Exception ex) { return(JsonNet.JsonError(ex.Message + '\n' + ex.StackTrace)); } }