# SharePoint Client Object Model: Verifying if a Field is part of a Content Type

- Link: https://saguiitay.com/sharepoint-client-object-model-verifying-if-a-field-is-part-of-a-content-type/
- Published: 2011-09-14T13:08:00+03:00
- Author: Itay

Before adding a field to a ContentType, it is important to check that the field 
is not already part of the Content Type.

Here’s an extension method to ClientContext that does just that:

    ```notranslate
    public static bool ExistInContentType( this ClientContext clientContext, ContentType contentType, Field field)
    {
        var fieldLinks = contentType.FieldLinks;
        var existingFields = clientContext.LoadQuery(fieldLinks.Where(fl = fl.Id == field.Id));
        clientContext.ExecuteQuery();
        var existingField = existingFields.FirstOrDefault();
        if (existingField != null)
            return true;
        return false;
    }
    ```

### _Related_
