Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RssFeeds
- {
- [Key]
- public int RssFeedsId { get; set; }
- public string Indeficator { get; set; }
- [Display(Name = "Источник" )]
- public string Source { get; set; }
- [Display(Name = "Название новости")]
- public string TitleNew { get; set; }
- [Display(Name = "Описание новости")]
- public string News { get; set; }
- [Display(Name = "Дата публикации")]
- public string Date { get; set; }
- }
- public class DataBaseContext : DbContext
- {
- public DataBaseContext(DbContextOptions<DataBaseContext> options) : base(options)
- {
- }
- public virtual DbSet<RssFeeds> RssFeeds { get; set; }
- }
- public class Sorted : ISorted
- {
- public List<RssFeeds> getSortDateHabr()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Date).Where(m => m.Indeficator == "H").ToList();
- return list;
- }
- public List<RssFeeds> getSortDateInterFax()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Date).Where(m => m.Indeficator == "I").ToList();
- return list;
- }
- public List<RssFeeds> getSortSourceHabr()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Source).Where(m => m.Indeficator == "H").ToList();
- return list;
- }
- public List<RssFeeds> getSortSourceInterFax()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Source).Where(m => m.Indeficator == "I").ToList();
- return list;
- }
- public List<RssFeeds> getSortSDateAll()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Date).ToList();
- return list;
- }
- public List<RssFeeds> getSortSourceAll()
- {
- List<RssFeeds> list = db.RssFeeds.OrderBy(p => p.Source).ToList();
- return list;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement