Пример #1
0
        public JsonResult InsertEmployee([FromBody] Employee data)
        {
            var empData = new Employee()
            {
                En           = data.En,
                Name         = data.Name,
                Age          = data.Age,
                Salary       = data.Salary,
                Departmentid = data.Departmentid,
                Alive        = "Y"
            };

            _context.Add(empData);
            _context.SaveChanges();

            return(Json(empData));
        }
Пример #2
0
        public JsonResult InsertEmployee([FromBody] Employee emp)
        {
            var empdata = new Employee()
            {
                En           = emp.En,
                Name         = emp.Name,
                Age          = emp.Age,
                Salary       = emp.Salary,
                DepartmentId = emp.DepartmentId,
                Alive        = "Y"
            };

            _context.Add(empdata);
            _context.SaveChanges();

            return(Json("ss"));
        }