public HomeViewModel()
        {
            homeImages = new HomeImageContext().homeImageLists.ToList();

            DefenseNewsContext defenseContext = new DefenseNewsContext();

            defenseNews = (from item in defenseContext.defenseNewsLists
                           orderby item.defenseNews_release_time descending
                           select item).ToList();

            NewsInfoContext newsInfoContext = new NewsInfoContext();

            news = (from item in newsInfoContext.newsInfoLists
                    orderby item.new_release_time descending
                    select item).ToList();

            MediaImpressContext mediaImpressContext = new MediaImpressContext();

            mediaImpress = (from item in mediaImpressContext.mediaImpressLists
                            orderby item.mediaImpress_release_time descending
                            select item).ToList();

            slogans = new SloganContext().sloganLists.ToList();

            masterView = new MasterViewModel();
        }
Example #2
0
 public MasterViewModel()
 {
     LinkTable    = new LinkListContext();
     ContactTable = new ContactContext();
     SuggestTable = new SuggestContext();
     SloganTable  = new SloganContext();
 }