public IActionResult GetAll() { string errorString = null; try { List <OrgObj> OrgObjects = new List <OrgObj>(); OrganizationModel orgModel = new OrganizationModel(); List <Organization> obj = orgModel.getAllOrganizations(out errorString); foreach (var org in obj) { OrgObjects.Add(new OrgObj(org)); } return(new JsonResult(OrgObjects)); } catch (Exception e) { return(Ok(e + "\n" + errorString)); } }
public IActionResult GetAll() { // return Ok(User.Claims.FirstOrDefault(x => x.Type.Equals("orgId")).Value); string errorString = null; try { List <OrgObj> OrgObjects = new List <OrgObj>(); OrganizationModel orgModel = new OrganizationModel(); List <Organization> obj = orgModel.getAllOrganizations(out errorString); foreach (var org in obj) { OrgObjects.Add(new OrgObj(org)); } return(new JsonResult(OrgObjects)); } catch (Exception e) { return(Ok(e + "\n" + errorString)); } }