private void detach_Employees(Employee entity) { this.SendPropertyChanging(); entity.Contact = null; }
partial void DeleteEmployee(Employee instance);
private void attach_Employees(Employee entity) { this.SendPropertyChanging(); entity.Contact = this; }
partial void InsertEmployee(Employee instance);
partial void UpdateEmployee(Employee instance);
public void TestNullableMethodAccess() { Employee[] employees = new Employee[] { new Employee { EmployeeID = 1, ManagerID = 1 }, new Employee { EmployeeID = 1, ManagerID = null } }; Assert.IsTrue(typeof(Employee).GetProperty("ManagerID").PropertyType == typeof(Nullable<int>)); IQueryable<Employee> query = new Employee[0].AsQueryable().Where(p => p.ManagerID == 1); IQueryable<Employee> query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable()); Assert.AreEqual(1, query2.Count()); query = new Employee[0].AsQueryable().Where(p => p.ManagerID == null); query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable()); Assert.AreEqual(1, query2.Count()); }
public void TestInaccessibleMethods() { Employee[] employees = new Employee[] { new Employee { EmployeeID = 1 } }; IQueryable<Employee> query = new Employee[0].AsQueryable().Where(p => p.EmployeeID == LocalMethod(p.EmployeeID)); IQueryable<Employee> query2 = null; NotSupportedException expectedException = null; try { query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable()); } catch (NotSupportedException e) { expectedException = e; } Assert.AreEqual(string.Format(OpenRiaServices.DomainServices.Client.Services.Resource.QuerySerialization_MethodNotAccessible, "LocalMethod", typeof(QuerySerializationTests)), expectedException.Message); // test an unsupported static method expectedException = null; query = new Employee[0].AsQueryable().AsQueryable().Where(p => p.EmployeeID == LocalStaticMethod(p.EmployeeID)); try { query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable()); } catch (NotSupportedException e) { expectedException = e; } Assert.AreEqual(string.Format(OpenRiaServices.DomainServices.Client.Services.Resource.QuerySerialization_MethodNotAccessible, "LocalStaticMethod", typeof(QuerySerializationTests)), expectedException.Message); }
private bool FilterReports(Employee entity) { return (entity.ManagerID == this.EmployeeID); }
private void DetachReports(Employee entity) { entity.Manager = null; }
private void AttachReports(Employee entity) { entity.Manager = this; }
private bool FilterManager(Employee entity) { return (entity.EmployeeID == this.ManagerID); }
private bool FilterEmployee(Employee entity) { return (entity.EmployeeID == this.EmployeeID); }