void AddDataRowToDataTable(ref List <AppAccessDisplay> Dt, List <AppAccessDisplay> Dtt) { if (Dtt != null) { if (Dt == null) { Dt = Dtt; } else { Dt.AddRange(Dtt); } } }
void AddDataRowToDataTable2(ref List <AppAccessDisplay> Dt, List <AppAccessDisplay> Dtt) { if (Dtt != null) { if (Dt == null) { Dt = Dtt; } else { List <AppAccessDisplay> lol = Dt; var str = lol.Select(q => q.Entity.ModulesCode); Dt.AddRange(Dtt.Where(p => !str.Contains(p.Entity.ModulesCode))); lol = null; } } }