Aspectacular.Test.EfExtensionsTest.TestDbCtxGetOrAttach C# (CSharp) Method

TestDbCtxGetOrAttach() private method

private TestDbCtxGetOrAttach ( ) : void
return void
        public void TestDbCtxGetOrAttach()
        {
            //int id = LinqTests.customerIdWithManyAddresses;
            //var addresses = LinqTests.AwDal.List(db => db.QueryCustomerAddressesByCustomerID(id));
            //Assert.IsTrue(2 == addresses.Count);

            //LinqTests.AwDal.Invoke(db => db.ToStringEx(""));

            Customer cust = LinqTests.AwDal.Invoke(db => db.GetOrAttach(OrhpanCust, c => c.CustomerID));
            Assert.IsNull(cust.EmailAddress);

            Customer cust2;
            using(var dbc = new AdventureWorksLT2008R2Entities())
            {
                dbc.Configuration.LazyLoadingEnabled = false;

                cust = dbc.GetProxy(LinqTests.TestAspects).Single(db => db.QueryCustomerByID(LinqTests.CustomerIdWithManyAddresses));
                cust2 = dbc.GetProxy(LinqTests.TestAspects).Invoke(db => db.GetOrAttach(OrhpanCust));
            }
            Assert.IsNotNull(cust2.EmailAddress);
            Assert.IsTrue(cust.Equals(cust2));
        }
EfExtensionsTest