예제 #1
0
파일: UnitOfWork.cs 프로젝트: linfx/LinFx
    /// <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;
    }
예제 #2
0
 public virtual IUnitOfWork Create()
 {
     return(Create(_defaultOptions.Clone()));
 }