Exemplo n.º 1
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="options"></param>
    /// <exception cref="Exception"></exception>
    public virtual void Initialize(UnitOfWorkOptions options)
    {
        Check.NotNull(options, nameof(options));

        if (Options != null)
        {
            throw new Exception("This unit of work is already initialized before!");
        }

        Options    = _defaultOptions.Normalize(options.Clone());
        IsReserved = false;
    }
Exemplo n.º 2
0
 public virtual IUnitOfWork Create()
 {
     return(Create(_defaultOptions.Clone()));
 }