Beispiel #1
0
        public void TestPersisAfterAddObject()
        {
            String id = "131029190252201";

            IAS.DAL.Interfaces.IIASPersonEntities ctx    = DAL.DALFactory.GetPersonContext();
            AG_IAS_TEMP_PAYMENT_DETAIL            result = ctx.AG_IAS_TEMP_PAYMENT_DETAIL.SingleOrDefault(a => a.ID == id);

            AG_IAS_PAYMENT_DETAIL data = new AG_IAS_PAYMENT_DETAIL();

            result.MappingToEntity <AG_IAS_TEMP_PAYMENT_DETAIL, AG_IAS_PAYMENT_DETAIL>(data);

            ctx.AG_IAS_PAYMENT_DETAIL.AddObject(data);

            AG_IAS_PAYMENT_DETAIL t = ctx.AG_IAS_PAYMENT_DETAIL.SingleOrDefault(a => a.ID == id);

            Assert.IsNotNull(t);
        }
Beispiel #2
0
        public void TestCopyTransaction()
        {
            String id = "131029190252201";

            IAS.DAL.Interfaces.IIASPersonEntities ctx    = DAL.DALFactory.GetPersonContext();
            AG_IAS_TEMP_PAYMENT_DETAIL            result = ctx.AG_IAS_TEMP_PAYMENT_DETAIL.SingleOrDefault(a => a.ID == id);

            AG_IAS_PAYMENT_DETAIL data = new AG_IAS_PAYMENT_DETAIL();

            result.MappingToEntity <AG_IAS_TEMP_PAYMENT_DETAIL, AG_IAS_PAYMENT_DETAIL>(data);

            ctx.AG_IAS_PAYMENT_DETAIL.AddObject(data);
            ctx.AddToAG_IAS_PAYMENT_DETAIL(data);
            ctx.ObjectStateManager.ChangeObjectState(data, System.Data.EntityState.Added);
            //AG_IAS_PAYMENT_DETAIL obj_a = ctx.AG_IAS_PAYMENT_DETAIL.SingleOrDefault(a => a.ID == id);
            //AG_IAS_PAYMENT_DETAIL obj_b = ctx.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added).Select(obj => obj.Entity).OfType<AG_IAS_PAYMENT_DETAIL>().SingleOrDefault(a => a.ID == id);
            ctx.SaveChanges();
            ctx = null;

            ctx = DAL.DALFactory.GetPersonContext();
            AG_IAS_PAYMENT_DETAIL newobj = ctx.AG_IAS_PAYMENT_DETAIL.SingleOrDefault(a => a.ID == id);

            Assert.IsNotNull(newobj);
        }