protected virtual DataTable GetAllData() { using (var context = new MyDataContext()) { var data = context.Set <T>(); return(MyDataContext.LINQToDataTable(data)); } }