Пример #1
0
        /// <summary>
        /// Metoda do konstruowania i wywoływania zapytania za pomocą sesji NHibernate
        /// </summary>
        /// <param name="session">Sesja NHibernate</param>
        public override ProductForm Execute(ISession session)
        {
            var product = session.Get <Domain.Product.Product>(productId);

            if (product == null)
            {
                throw new TechnicalException(String.Format("Nie można znaleźć produktu o podanym id: {0}", productId));
            }

            return(ProductMapper.MapProductToForm(product));
        }
        /// <summary>
        /// Metoda do konstruowania i wywoływania zapytania za pomocą sesji NHibernate
        /// </summary>
        /// <param name="session">Sesja NHibernate</param>
        public override ProductForm Execute(ISession session)
        {
            var product = session.Get <Domain.Product.Product>(productId);

            if (product == null)
            {
                throw new TechnicalException(String.Format("The product with the given id can not be found: { 0}", productId));
            }

            return(ProductMapper.MapProductToForm(product));
        }