コード例 #1
0
        public Pick PickCard(Draft draft, Member member, Card card)
        {
            var pick = new Pick() { Draft = draft, Member = member, Card = card, CreatedDate = DateTime.Now};

            using (ISession session = NHibernateHelper.OpenSession())
            using (ITransaction transaction = session.BeginTransaction())
            {
                session.Save(pick);
                transaction.Commit();
            }

            return pick;
        }
コード例 #2
0
 public void RemovePick(Pick pick)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     using (ITransaction transaction = session.BeginTransaction())
     {
         session.Delete(pick);
         transaction.Commit();
     }
 }