When working with Windows Form controls and LINQ is there a "Best Option" for how your Buisiness Layer returns the Data?
Right now I am returning DataTables so that I can then set the DataSource to the returned DataTable. Is there a better option? Why?
public class BLLMatrix
{
public static DataTable GetMaintItems(int iCat)
{
IQueryable<tblCaseNotesMaintItem> tItems = DALMatrix.GetCNTable();
return
(tItems.Where(item => item.CategoryID == iCat & item.IsActive).OrderBy(item => item.OrderID).Select(
item => new { item.ItemID, item.ItemDescription })).CopyLinqToDataTable();
}
internal static class DALMatrix
{
internal static MatrixDataContext MatrixDataContext = new MatrixDataContext();
internal static Table<tblCaseNotesMaintItem> GetCNTable()
{
return MatrixDataContext.GetTable<tblCaseNotesMaintItem>();
}
I found this similar question --> http://stackoverflow.com/questions/51176/seperating-concerns-with-linq-to-sql-and-dtos