コード例 #1
0
 public void Dispose()
 {
     if (context != null)
     {
         context.Dispose();
     }
 }
コード例 #2
0
        /// <summary>
        /// The bulk of the clean-up code is implemented in Dispose(bool).
        /// </summary>
        /// <param name="disposing">Disposing parameter.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            if (users != null)
            {
                users.Dispose();
            }

            if (databaseContext != null)
            {
                databaseContext.Dispose();
            }

            GC.SuppressFinalize(this);
        }