if list does not contain then add csharp

Code Example - if list does not contain then add csharp

                
                        if (!myList.Contains("name"))
{
    myList.Add("name");
}