'updating a list using linq C#

I have list in which I want to update is active flag from all user like

userList:[
    {'name':'a', isActive:'Y'},
    {'name':'b', isActive:'N'},
    {'name':'c', isActive:'Y'},
    {'name':'d', isActive:'N'},
];

I want to change isActive from Y to N and from N to Y, my updated list will look like below

userList:[
    {'name':'a', isActive:'N'},
    {'name':'b', isActive:'Y'},
    {'name':'c', isActive:'N'},
    {'name':'d', isActive:'Y'},
];

how can I achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source