示例#1
0
        //Determine whether a new unit of work needs to be created
        private bool NeedCreateNewUnitOfWork(UnitOfWorkOptions options)
        {
            bool result = false;

            switch (options.Limit)
            {
            case UnitOfWorkLimit.Required:
                result = _callcontext.GetCurrentUow() == null;
                break;

            case UnitOfWorkLimit.RequiresNew:
                result = true;
                break;

            case UnitOfWorkLimit.Suppress:
                result = true;
                break;

            default:
                break;
            }
            return(result);
        }
示例#2
0
文件: UnitOfWork.cs 项目: qkb/MiCake
 public void SetOptions(UnitOfWorkOptions options)
 {
     UnitOfWorkOptions = options.Clone();
 }
示例#3
0
 /// <summary>
 /// Child unit of work invalid settings.because it's use parent options
 /// </summary>
 /// <param name="options"></param>
 public void SetOptions(UnitOfWorkOptions options)
 {
     //_parentUow.SetOptions(options);
 }