<commit_before>﻿using Blog.Extensions;
using Blog.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;

namespace Blog.Controllers
{
    public class ArticleController : Controller
    {
        // GET: Article
        public ActionResult Index()
        {
            return RedirectToAction("ListLast");
        }

        // GET: Article/List
        public ActionResult List()
        {
            using (var database = new BlogDbContext())
            {
                var articles = database.Articles
                    .Include(a => a.Author)
                    .Include(a => a.Tags)
                    .OrderByDescending(a => a.Date)
                    .ToList();
                
                return View(articles);
            }
        }

        // GET: Article/List Last 4
        public ActionResult ListLast()
        {
            using (var database = new BlogDbContext())
            {
                var articles = database.Articles
                    .Include(a => a.Author)
                    .Include(a => a.Tags)
                    .Take(4)
                    .OrderByDescending(a => a.Date)<commit_msg>fix ordering the last 4 articles<commit_after>﻿using Blog.Extensions;
using Blog.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;

namespace Blog.Controllers
{
    public class ArticleController : Controller
    {
        // GET: Article
        public ActionResult Index()
        {
            return RedirectToAction("ListLast");
        }

        // GET: Article/List
        public ActionResult List()
        {
            using (var database = new BlogDbContext())
            {
                var articles = database.Articles
                    .Include(a => a.Author)
                    .Include(a => a.Tags)
                    .OrderByDescending(a => a.Date)
                    .ToList();
                
                return View(articles);
            }
        }

        // GET: Article/List Last 4
        public ActionResult ListLast()
        {
            using (var database = new BlogDbContext())
            {
                var articles = database.Articles
                    .Include(a => a.Author)
                    .Include(a => a.Tags)
                    .OrderByDescending(a => a.Date)
                    .Take(4)
{'fraction_non_alphanumeric': 0.09398645957785742, 'fraction_numerical': 0.001991238550378335, 'mean_word_length': 1.3564727954971858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4316004', 'n_tokens_mistral': 643, 'n_tokens_neox': 616, 'n_words': 154}