public IActionResult Delete([FromQuery] string dn, [FromQuery] string name) { if (!string.IsNullOrWhiteSpace(dn) && !string.IsNullOrWhiteSpace(name)) { if (_orgService.Delete(dn, name)) { return(Ok()); } return(NoContent()); } return(BadRequest()); }
static void DeleteProgram(Guid organizationalUnitGuid) { ServiceFactory factory = new ServiceFactory(); IOrganizationalUnitService ouService = factory.CreateOrganizationalUnitService(); bool success = ouService.Delete(organizationalUnitGuid); if (!success) { Console.WriteLine("ErrorCode: " + ouService.LastError.ErrorCode); Console.WriteLine("ErrorMessage: " + ouService.LastError.ErrorCodeString); } else { Console.WriteLine(string.Format("Organizational Unit [{0}] was deleted.", organizationalUnitGuid)); } }