コード例 #1
0
        public int AddStandartSize(IStandartSize aStandartSize)
        {
            var entity = new StandartSizeEntity {
                Diameter = aStandartSize.GetDiameter()
            };

            using (var session = NHibernateHelper.OpenSession()) {
                using (var transaction = session.BeginTransaction()) {
                    session.Save(entity);
                    transaction.Commit();
                }
            }

            return entity.Id;
        }
コード例 #2
0
        public int AddStandartSize(IStandartSize aStandartSize)
        {
            var entity = new StandartSizeEntity {
                Height = aStandartSize.GetHeight(),
                Width = aStandartSize.GetWidth(),
                Length = aStandartSize.GetLength()
            };

            using (var session = NHibernateHelper.OpenSession()) {
                using (var transaction = session.BeginTransaction()) {
                    session.Save(entity);
                    transaction.Commit();
                }
            }

            return entity.Id;
        }