/// <summary> /// Initialize a new instance of the class. /// </summary> /// <param name="item">Entity item.</param> /// <param name="handler">Work handler.</param> /// <param name="workType">Work type.</param> public Work(IEntity item, IUnitOfWorkHandler handler, WorkType workType) { _item = item; _handler = handler; _workType = workType; _entryDateTime = DateTime.UtcNow; }
/// <summary> /// Register the given item that is to be removed from a persistent storage. /// </summary> /// <param name="item">Item to be register as removed.</param> /// <param name="handler">The handler that will do the removing. It will be called by /// unit of work during removing the item.</param> public void RegisterRemoved(IEntity item, IUnitOfWorkHandler handler) { ThrowIfDisposed(); _workList.Add(new Work(item, handler, WorkType.Removed)); }