static void UpdateProgram(Guid organizationalUnitGuid) { ServiceFactory factory = new ServiceFactory(); IOrganizationalUnitService ouService = factory.CreateOrganizationalUnitService(); var oUnit = new OrganizationalUnit(); // the following are required fields. oUnit.OrganizationalUnitGuid = new Guid(organizationalUnitGuid.ToString()); oUnit.Name = "Updated Organization Unit"; // the following are optional. bool success = ouService.Update(oUnit); if (!success) { Console.WriteLine("ErrorCode: " + ouService.LastError.ErrorCode); Console.WriteLine("ErrorMessage: " + ouService.LastError.ErrorCodeString); } else { Console.WriteLine(string.Format("User {0} was updated.", oUnit.Name)); } }
public IActionResult Put([FromBody] OrganizationalUnitVO orgUnit) { if (orgUnit == null) { return(BadRequest()); } return(new ObjectResult(_orgService.Update(orgUnit))); }