private void FillDataGrid() { var entities = (from n in DataContext.LP_EBooks where n.DateDeleted == null orderby n.DateCreated descending select n).ToList(); var converter = new EBookEntityModelConverter(DataContext); var models = (from n in entities let m = converter.Convert(n) select m).ToList(); var model = new EBooksModel(); model.List = models; eBooksControl.Model = model; }
private void FillEBooks() { var currentLanguage = LanguageUtil.GetLanguage(); var query = from n in DataContext.LP_EBooks where n.DateDeleted == null && (n.Language == currentLanguage || n.Language == null || n.Language == "") orderby n.OrderIndex, n.DateCreated descending select n; var entities = query.ToList(); var converter = new EBookEntityModelConverter(DataContext); var models = (from n in entities let m = converter.Convert(n) select m).ToList(); var model = new EBooksModel(); model.List = models; eBooksControl.Model = model; }