private void UpdateEmployee(int employeeId, string userId) { using (SecureEmployeeCreatorDbContext db = new SecureEmployeeCreatorDbContext()) { employeeId = db.UpdateEmployee(employeeId, userId); } }
private int CreateEmployee() { int employeeId = 0; try { using (SecureEmployeeCreatorDbContext db = new SecureEmployeeCreatorDbContext()) { employeeId = db.CreateEmployee(); } } catch (Exception e) { throw new FailedDatabaseConnectionException("Cannot create employee"); } return(employeeId); }