public void Ctor_EntityMatch()
        {
            var expectedEntity = new TestEntity();
            var subject        = new EntityAddingPackage <TestEntity>(expectedEntity);

            Assert.Same(expectedEntity, subject.Entity);
        }
Example #2
0
        /// <summary>
        /// Adds an entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>The task.</returns>
        public async Task AddAsync(TEntity entity, CancellationToken cancellationToken = default)
        {
            var addingPackage = new EntityAddingPackage <TEntity>(entity);
            await ProcessorPipeline.ProcessAsync(addingPackage, cancellationToken);

            await ExecuteAddAsync(entity, cancellationToken);

            var addedPackage = new EntityAddedPackage <TEntity>(entity);
            await ProcessorPipeline.ProcessAsync(addedPackage, cancellationToken);
        }
 public Task ProcessAsync(EntityAddingPackage <TestEntity> package, CancellationToken cancellationToken = default)
 {
     throw new System.NotImplementedException();
 }