public PreprocessorEntity( TEntity entity, EntityOrigin origin, bool?mappingExists) { this.Entity = entity; this.origin = origin; this.mappingExists = mappingExists; this.IsRejected = false; }
/// <summary> /// Preprocesses the specified entity. /// </summary> /// <param name="entity"> /// The (source/destination system) entity that is being preprocessed. /// </param> /// <param name="origin"> /// The origin of the entity that is being preprocessed (source/destination /// system). /// </param> /// <param name="mappingExists"> /// A value indicating whether a mapping to an existing destination system entity /// exists for the entity, which is a source system entity; ignored if origin is /// DestinationSystem. /// </param> /// <returns>The entity after being preprocessed.</returns> public PreprocessedEntity <TEntity> Preprocess( TEntity entity, EntityOrigin origin, bool?mappingExists = null) { var preprocessorEntity = new PreprocessorEntity(entity, origin, mappingExists); IEnumerable <IPreprocessorOperation <TEntity> > operations = this.GetPreprocessorOperations(origin); foreach (IPreprocessorOperation <TEntity> operation in operations) { operation.Preprocess(preprocessorEntity); } return(new PreprocessedEntity <TEntity>( preprocessorEntity.Entity, preprocessorEntity.IsRejected)); }
GetPreprocessorOperations(EntityOrigin origin) { return(origin == EntityOrigin.SourceSystem ? this.serviceProvider.SourceSystemPreprocessorOperations : this.serviceProvider.DestinationSystemPreprocessorOperations); }