public void ModifyDomain(Geodatabase geodatabase, string codedValueDomainName = "Pipe")
{
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
CodedValueDomain codedValueDomain = geodatabase.GetDomains().First(f => f.GetName().Equals(codedValueDomainName)) as CodedValueDomain;
CodedValueDomainDescription codedValueDomainDescription = new CodedValueDomainDescription(codedValueDomain);
// Update domain description
codedValueDomainDescription.Description = "Water Pipe Domain";
// Adding code/value pair
codedValueDomainDescription.CodedValuePairs.Add("C", "Copper");
schemaBuilder.Modify(codedValueDomainDescription);
// To modify the orders of coded value domain
// schemaBuilder.Modify(codedValueDomainDescription,SortBy.Name,SortOrder.Ascending);
schemaBuilder.Build();
}