Ejemplo n.º 1
0
        private void CreateCase2()
        {
            Casee         cas = new Casee();
            CaseToCaseTag ctc = new CaseToCaseTag();

            using (var tx = Session.BeginTransaction())
            {
                ctc.Right    = cas;
                cas.CaseTags = new HashSet <CaseToCaseTag>();
                cas.CaseTags.Add(ctc);

                Session.Save(cas);
                tx.Commit();
            }

            cas.CaseTags.Remove(ctc);
            using (var tx = Session.BeginTransaction())
            {
                Session.Save(cas);
                tx.Commit();
            }
        }
Ejemplo n.º 2
0
        private void CreateCase1()
        {
            Casee         cas = new Casee();
            CaseToCaseTag ctc = new CaseToCaseTag();

            using (var tx = Session.BeginTransaction())
            {
                ctc.Right    = cas;
                cas.CaseTags = new HashSet <CaseToCaseTag>();
                cas.CaseTags.Add(ctc);

                Session.Save(cas);
                tx.Commit();
            }

            cas.CaseTags.Remove(ctc);
            cas.LastModifyDate = DateTime.UtcNow.AddHours(-5);
            using (var tx = Session.BeginTransaction())
            {
                Session.Save(cas);
                tx.Commit();
            }
        }