public ActionResult Index() { var db = new SnitchDb(); var users = new User() { Name = "Marlowe", UserActions = new List <UserAction>() { new UserAction() { ActionName = "Component template" } } }; var model = new Peeps(); var userAction = new UserAction() { ActionName = "Content marlowe", ActionDetails = "Component Template", ActionTime = DateTime.Now }; db.Users.Add(users); db.UserAction.Add(userAction); db.SaveChanges(); if (db.UserAction != null) { model.UserList = db.Users.ToList(); } model.UserList.Add(users); return(View(model)); }
public void Add(User entity) { _database.Users.Add(entity); _database.SaveChanges(); }
public void Add(UserAction entity) { _database.UserAction.Add(entity); _database.SaveChanges(); }