public static bool DeleteMapping(long id, MappingManager mappingManager, bool recursive = true) { Mapping mapping = mappingManager.GetMappings(id); if (recursive) { IEnumerable <Mapping> childMappings = mappingManager.GetChildMapping(id); foreach (var cm in childMappings) { mappingManager.DeleteMapping(cm.Id); } } mappingManager.DeleteMapping(mapping.Id); return(true); }