コード例 #1
0
		private void detach_Employees(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Contact = null;
		}
コード例 #2
0
 partial void DeleteEmployee(Employee instance);
コード例 #3
0
		private void attach_Employees(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Contact = this;
		}
コード例 #4
0
 partial void InsertEmployee(Employee instance);
コード例 #5
0
 partial void UpdateEmployee(Employee instance);
コード例 #6
0
        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());
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 private bool FilterReports(Employee entity)
 {
     return (entity.ManagerID == this.EmployeeID);
 }
コード例 #9
0
 private void DetachReports(Employee entity)
 {
     entity.Manager = null;
 }
コード例 #10
0
 private void AttachReports(Employee entity)
 {
     entity.Manager = this;
 }
コード例 #11
0
 private bool FilterManager(Employee entity)
 {
     return (entity.EmployeeID == this.ManagerID);
 }
コード例 #12
0
 private bool FilterEmployee(Employee entity)
 {
     return (entity.EmployeeID == this.EmployeeID);
 }