I have a data like
public class PermList
{
public int UserId { get; set; }
public int GroupId { get; set; }
public int ModuleId { get; set; }
public int BitMaskedPermission { get; set; }
public List<PermList> TestData()
{
List<PermList> theList = new List<PermList>();
PermList sample1 = new PermList {BitMaskedPermission = 15, GroupId = 3, ModuleId = 2, UserId = 1};
theList.Add(sample1);
PermList sample2 = new PermList { BitMaskedPermission = 2, GroupId = 3, ModuleId = 1, UserId = 1 };
theList.Add(sample2);
PermList sample3 = new PermList { BitMaskedPermission = 48, GroupId = 2, ModuleId = 2, UserId = 1 };
theList.Add(sample3);
return theList;
}
}

I would like to apply OR to BitMaskedPermissions with grouping ModuleId. Here is what I would like to get;

How can I achieve this with using Linq.
TIA.