MODELS [1] CREATE USER MODEL ----------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace _1___kushan.Models { public class User { public int ID { get; set; } public string Name { get; set; } } } [2] CREATE DB CONTEXT --------------------- namespace _1___kushan.Models { public class Context : DbContext { public DbSet<Models.User> Users { get; set; } } } CONTROLLER [3] CREATE CONTROLLER --------------------- using _1___kushan.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace _1___kushan.Controllers { public class UserController : Controller { // // GET: /User/ public ActionResult Index() { return View(); } //RESPONSE FOR SIMPLE BUTTON CLICK [HttpPost] public ActionResult Index(Models.User user) { Context con = new Context();//object with context User u = new User//user model { Name = user.Name }; con.Users.Add(u);//adding con.SaveChanges();//wr
Lemme engineeracle your Software Warcraft! One place for tech explorations of Kushan and up to date contents on cloud-based business productivity and enterprise collaboration.