Ejemplo n.º 1
0
        public void SaveSelfCycle()
        {
            using (Transaction tr = new Transaction())
            using (OperationLogic.AllowSave<ArtistDN>())
            {
                ArtistDN m = new ArtistDN() { Name = "Michael" };
                m.Friends.Add(m.ToLiteFat());

                m.Save();

                var m2 = m.ToLite().RetrieveAndForget();

                Assert.IsTrue(m2.Friends.Contains(m2.ToLite()));

                //tr.Commit();
            }

        }
Ejemplo n.º 2
0
        public void SaveCycle()
        {
            using (Transaction tr = new Transaction())
            using (OperationLogic.AllowSave<ArtistDN>())
            {
                ArtistDN m = new ArtistDN() { Name = "Michael" };
                ArtistDN f = new ArtistDN() { Name = "Frank" };
                m.Friends.Add(f.ToLiteFat());
                f.Friends.Add(m.ToLiteFat());

                Database.SaveParams(m, f);

                var list = Database.Query<ArtistDN>().Where(a => a == m || a == f).ToList();

                Assert.IsTrue(list[0].Friends.Contains(list[1].ToLite()));
                Assert.IsTrue(list[1].Friends.Contains(list[0].ToLite()));

                //tr.Commit();
            }

        }