Пример #1
0
 /// <summary>
 /// Saves the <paramref name="process"/> root to the <paramref name="repository"/>.
 /// </summary>
 /// <param name="repository">The repository to save the process root to.</param>
 /// <param name="process">The process root to save.</param>
 /// <param name="commandKey">A key of the command.</param>
 /// <returns>A continuation task.</returns>
 protected virtual Task SaveProcessAsync(IProcessRootRepository <T> repository, T process, IKey commandKey)
 => repository.SaveAsync(process, commandKey);
 /// <summary>
 /// Saves the <paramref name="process"/> root to the <paramref name="repository"/>.
 /// </summary>
 /// <param name="repository">The repository to save the process root to.</param>
 /// <param name="process">The process root to save.</param>
 protected virtual void SaveProcess(IProcessRootRepository <T> repository, T process, IKey commandKey)
 {
     repository.Save(process, commandKey);
 }
Пример #3
0
 /// <summary>
 /// Loads aggregate root with the <paramref name="key"/> from the <paramref name="repository"/>.
 /// </summary>
 /// <param name="repository">The repository to load the process root from.</param>
 /// <param name="key">The key of the process root to load.</param>
 /// <returns>The loaded process root.</returns>
 protected virtual Task <T> GetProcessAsync(IProcessRootRepository <T> repository, IKey key)
 => repository.GetAsync(key);
        /// <summary>
        /// Loads aggregate root with the <paramref name="key"/> from the <paramref name="repository"/>.
        /// </summary>
        /// <param name="repository">The repository to load the process root from.</param>
        /// <param name="key">The key of the process root to load.</param>
        /// <returns>The loaded process root.</returns>
        protected virtual T GetProcess(IProcessRootRepository <T> repository, IKey key)
        {
            T aggregate = repository.Get(key);

            return(aggregate);
        }