The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
807 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Blog.Models;
using Teknik.Controllers;
using Teknik.Models;
namespace Teknik.Areas.Home.Controllers
{
public class HomeController : DefaultController
{
// GET: Home/Home
private TeknikEntities db = new TeknikEntities();
[AllowAnonymous]
public ActionResult Index()
{
List<Post> lastPosts = new List<Post>();
var found = db.Posts.Include("Blog").Include("Blog.User").OrderBy(post => post.DatePosted).Where(p => p.Published).Take(10);
if (found != null)
lastPosts = found.ToList();
ViewBag.Title = Config.Title;
return View(lastPosts);
}
}
}