I have multiple classes with the same property. I want to create a single method that would serve the same purpose for each individual class.

**Example:**

```
 private void RefreshSelection<T>(ObservableCollection<T> itemList, T selectedItem)
    {
        foreach (var item in itemList)
        {
            item.IsSelected = selectedItem.Equals(item);
        }
    }

```

As expected, I recieve this error:

```
'T' does not contain a definition for 'IsSelected' and no extension method 'IsSelected' accepting a first argument of type 'T' could be found (are you missing a using directive or an assembly reference?)

```

I have tried to find a useful answer but can only find examples of retrieving the property value, not changing it. Any advice is greatly appreciated.