Exemplo n.º 1
0
        /// <summary>
        ///     Asynchronously saves all changes made in this context to the underlying database.
        /// </summary>
        /// <param name="cancellationToken">A <see cref="CancellationToken" /> to observe while waiting for the task to complete.</param>
        /// <returns>
        ///     A task that represents the asynchronous save operation.
        ///     The task result contains the number of Objects written to the underlying database.
        /// </returns>
        public virtual Task <Int32> SaveChangesAsync(CancellationToken?cancellationToken = null)
        {
            Logger.Trace("Enter - Exit on next line.");

            return(cancellationToken == null
                ? DbCommit.CommitAsync()
                : DbCommit.CommitAsync(cancellationToken.Value));
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Saves all changes made in this context to the underlying database.
        /// </summary>
        /// <returns>The number of Objects written to the underlying database.</returns>
        public virtual Int32 SaveChanges()
        {
            Logger.Trace("Enter - Exit on next line.");

            return(DbCommit.Commit());
        }