public void Post([FromBody] Employee newEmployee) { Leadando_dbContext context = new Leadando_dbContext(); context.Employees.Add(newEmployee); context.SaveChanges(); }
public int M1() { Leadando_dbContext context = new Leadando_dbContext(); var employeeCount = (from x in context.Employees select x.EmployeeId).Count(); return(employeeCount); }
public Employee Get(int id) { Leadando_dbContext context = new Leadando_dbContext(); var keresettDolgozo = (from x in context.Employees where x.EmployeeId == id select x).FirstOrDefault(); return(keresettDolgozo); }
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(); }
public IEnumerable <Employee> Get() { Leadando_dbContext context = new Leadando_dbContext(); return(context.Employees.ToList()); }