コード例 #1
0
 /// <summary>
 /// Discards all pending changes to this controller's managed <see cref="EnterpriseTestContext" />.
 /// </summary>
 public void DiscardChanges()
 {
     // Dispose of the old context - a new one will be created when needed
     if (_context != null)
     {
         _context.Dispose();
         _context = null;
     }
 }
コード例 #2
0
 /// <summary>
 /// Clean up data context.
 /// </summary>
 public void Dispose()
 {
     if (_context != null)
     {
         _context.Dispose();
         _context = null;
     }
 }
コード例 #3
0
        public EnterpriseTestContext GetEditContext()
        {
            // Dispose of the old context and create a new one.
            // This ensures that any changes or cached data are forgotten.
            _context?.Dispose();

            _context = new EnterpriseTestContext(_connectionString);
            return(_context);
        }
コード例 #4
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _context.Dispose();
            }

            base.Dispose(disposing);
        }