Ejemplo n.º 1
0
        public ActionResult Index(TableData data)
        {
            using (var dbContext = new ExampleDB())
            {
                dbContext.TData.Add(data);
                dbContext.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public IActionResult Post(UserDto userDto)
        {
            User user = new User();

            user.Email     = userDto.Email;
            user.FirstName = userDto.FirstName;
            user.LastName  = userDto.LastName;

            _db.User.Add(user);
            _db.SaveChanges();

            return(Ok("Success"));
        }