protected TypeContract RemoveInvariantMethods(ITypeDefinition typeDefinition, NamedTypeDefinition cciTypeDefinition) { var tc = typeDefinition.TypeContract() as TypeContract; if (tc != null) { tc.Invariants.Clear(); var methods = ContractHelper.GetInvariantMethods(cciTypeDefinition).ToList(); foreach (var m in methods) { cciTypeDefinition.Methods.Remove(m); } } return(tc); }