protected OcUnitOfWorkBase(string name, IOcTextLog log) { State = OcUnitOfWorkState.InProgress; WhenCreated = DateTime.UtcNow; InstanceId = Interlocked.Increment(ref _identity); Name = $"UoW#{InstanceId}{(string.IsNullOrWhiteSpace(name) ? "" : ":" + name)}"; TextLog = log; }
public OcRequest([NotNull] string name, OcRequestOptions options, IOcTextLog log) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } Name = name; Options = options; Log = log; }
public OcUserRequest([NotNull] string name, OcRequestOptions options, TUser user, IOcTextLog log) : base(name, options, log) { User = user; }
public OcWorkRequest([NotNull] string name, OcRequestOptions options, TWork unitOfWork, IOcTextLog log) : base(name, options, log) { if (unitOfWork == null) { throw new ArgumentNullException(nameof(unitOfWork)); } if (unitOfWork.State != OcUnitOfWorkState.InProgress) { throw new ArgumentException($"Unit of work must be in state InProgress but is [{unitOfWork.State}]", nameof(unitOfWork)); } UnitOfWork = unitOfWork; }
protected OcUnitOfWorkBase(IOcTextLog log) : this(null, log) { }
public OcUserWorkRequest([NotNull] string name, OcRequestOptions options, TUser user, TWork unitOfWork, IOcTextLog log) : base(name, options, unitOfWork, log) { User = user; }