using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using GreenTree.Nachtragsmanagement.Web.Framework; using GreenTree.Nachtragsmanagement.Web.Models.User; namespace GreenTree.Nachtragsmanagement.Web.Controllers { public class HomeController : Controller { // GET: Home public ActionResult Index() { return View("~/Views/Home/Index.cshtml"); } [HttpPost] public ActionResult Index(UserModel model) { var userSet = ApplicationContext.Current.DbContextService.GetDbSet(); var dbContext = ApplicationContext.Current.DbContextService.GetDbContext(); var newUser = new Core.Domain.User.User { CustomId = model.CustomId, Forename = model.Forename, Lastname = model.Lastname, MailAddress = model.MailAddress }; userSet.Add(newUser); dbContext.SaveChanges(); return View("~/Views/Home/Index.cshtml"); } } }