public List<Posts> GetAllPosts(Blogs blog, int count) { try { return db.Posts.Where(p => p.BlogsID == blog.BlogsID).OrderByDescending(p => p.Created).Take(count).ToList(); } catch (Exception e) { throw new Exception(e.InnerException.Message); } }
public List<Posts> GetAllPosts(Blogs blog) { try { return db.Posts.Where(p => p.BlogsID == blog.BlogsID).ToList(); } catch (Exception e) { throw new Exception(e.InnerException.Message); } }