コード例 #1
0
        public void Post([FromBody] Employee newEmployee)
        {
            Leadando_dbContext context = new Leadando_dbContext();

            context.Employees.Add(newEmployee);
            context.SaveChanges();
        }
コード例 #2
0
        public void Delete(int id)
        {
            Leadando_dbContext context = new Leadando_dbContext();
            var torlendoDolgozo        = (from x in context.Employees
                                          where x.EmployeeId == id
                                          select x).FirstOrDefault();

            context.Remove(torlendoDolgozo);
            context.SaveChanges();
        }