Ejemplo n.º 1
0
        public Blogs GetBlog(int id)
        {
            List <Blogs> test = _context.Blogs.Where(t => t.Id == id).ToList();
            Blogs        q    = test.First();

            return(_context.Blogs.Where(b => b.Id == id).First());
        }
Ejemplo n.º 2
0
        public void AddBlogs(string Title, string Summary, string Content, DateTime PublishedDateTime, int UserID)
        {
            Blogs newBlog = new Blogs
            {
                Title             = Title,
                Summary           = Summary,
                Content           = Content,
                PublishedDateTime = PublishedDateTime,
                UserID            = UserID
            };

            _context.Blogs.Add(newBlog);
            _context.SaveChanges();
        }
Ejemplo n.º 3
0
 public void AddBlogs(Blogs b)
 {
     _context.Blogs.Add(b);
     _context.SaveChanges();
 }