Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public void Add(User entity)
 {
     _database.Users.Add(entity);
     _database.SaveChanges();
 }
Exemplo n.º 3
0
 public void Add(UserAction entity)
 {
     _database.UserAction.Add(entity);
     _database.SaveChanges();
 }