Esempio n. 1
0
        /// <summary>
        /// Insert a new record
        /// </summary>
        /// <param name="XMQuestion">pXMQuestion</param>
        /// <returns>record</returns>
        public void Insert(XMQuestion pXMQuestion)
        {
            if (pXMQuestion == null)
            {
                throw new ArgumentNullException("pXMQuestion");
            }

            _context.XMQuestions.AddObject(pXMQuestion);
            _context.SaveChanges();
        }
Esempio n. 2
0
        /// <summary>
        /// Update a record
        /// </summary>
        /// <param name="XMQuestion">pXMQuestion</param>
        /// <returns>record</returns>
        public void Update(XMQuestion pXMQuestion)
        {
            if (pXMQuestion == null)
            {
                throw new ArgumentNullException("pXMQuestion");
            }

            if (!_context.IsAttached(pXMQuestion))
            {
                _context.XMQuestions.Attach(pXMQuestion);
            }

            _context.SaveChanges();
        }