Ejemplo n.º 1
0
        public void Ctor_EntityMatch()
        {
            var expectedEntity = new TestEntity();
            var subject        = new EntityAddedPackage <TestEntity>(expectedEntity);

            Assert.Same(expectedEntity, subject.Entity);
        }
Ejemplo n.º 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(EntityAddedPackage <TestEntity> package, CancellationToken cancellationToken = default)
 {
     throw new System.NotImplementedException();
 }