Ejemplo n.º 1
0
        /// <summary>
        /// Create an initial version number
        /// </summary>
        /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param>
        /// <param name="session">The current <see cref="ISession" />.</param>
        /// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        /// <returns>A seed value to initialize the versioned property with.</returns>
        public static async Task <object> SeedAsync(IVersionType versionType, ISessionImplementor session, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            object seed = await(versionType.SeedAsync(session, cancellationToken)).ConfigureAwait(false);

            if (log.IsDebugEnabled())
            {
                log.Debug("Seeding: {0}", seed);
            }
            return(seed);
        }