public JArray PostRole(Roles objRole) //insert data to the user table { try { int roleid = _roles.NextSequenceId(objRole); objRole.role_id = roleid; objRole.audit_ts = DateTime.Now; _roles.Create(objRole); return(GetRole()); //IList<Roles> objrRoleses = new List<Roles>(); //objrRoleses = _roles.GetAllData(); //return JArray.Parse(objrRoleses.ToJson(new JsonWriterSettings { OutputMode = JsonOutputMode.Strict })); } catch (Exception) { throw; } }
private void CreateMissingRoles(List <string> samlRoleNames) { foreach (string samlRole in samlRoleNames) { try { if (!_rolesApi.Find(samlRole).Any()) { _rolesApi.Create(samlRole, "Auto Created SAML based Role"); } } catch (Exception ex) { _eventLogApi.Write("RoleMembershipManager Error CreateMissingRoles: " + ex.Message + " : " + ex.StackTrace, new EventLogEntryWriteOptions() { Category = "SAML", EventId = 1, EventType = "Error" }); } } }