예제 #1
0
        public ActionResult NewPost(FormCollection collection)
        {
            DbActions dbacc = new DbActions();
            Post      po    = new Post
            {
                FechaCreacion = DateTime.Parse(collection["Fecha"].ToString()),
                Titulo        = collection["Titulo"],
                Contenido     = collection["Contenido"],
                Imagen        = collection["Imagen"],
                Categoria     = collection["Categoria"]
            };

            dbacc.Create(po);
            return(RedirectToAction("Index"));
        }