示例#1
0
        public ITranslator <TSchema> Create(TranslateFactoryContext <TSchema> context)
        {
            var builder = new TranslateBuilder <TSchema>(context);

            _specification.Apply(builder);

            return(builder.Build());
        }
示例#2
0
        public IEntityTranslator <TInput, TSchema> Create(TranslateFactoryContext <TSchema> context)
        {
            var builder = new EntityTranslateBuilder <TResult, TInput, TSchema>(context);

            _specification.Apply(builder);

            return(builder.Build());
        }
示例#3
0
        public IEntityTranslator <TInput, TSchema> Create(TranslateFactoryContext <TSchema> context)
        {
            var builder = new EntityTranslateBuilder <TResult, TInput, TSchema>(context);

            builder.CopyPropertyVisitor    = new HL7CopyTranslateBuilderPropertyVisitor <TResult, TInput, TSchema>(builder);
            builder.MissingPropertyVisitor = new HL7MissingTranslateBuilderPropertyVisitor <TResult, TInput, TSchema>(builder);

            _specification.Apply(builder);

            return(builder.Build());
        }
示例#4
0
        public EntityTranslateBuilder(TranslateFactoryContext <TSchema> context)
        {
            ImplementationType = context.GetImplementationType <TResult>();
            _context           = context;

            _propertyTranslaters = new Dictionary <string, IPropertyTranslateBuilder <TResult, TInput, TSchema> >();

            CopyPropertyVisitor    = new EntityCopyTranslateBuilderPropertyVisitor <TResult, TInput, TSchema>(this);
            MissingPropertyVisitor = new EntityMissingTranslateBuilderPropertyVisitor <TResult, TInput, TSchema>(this);

            ITranslateBuilderPropertyVisitor <TSchema> DefaultPropertyVisitor() => CopyPropertyVisitor;

            _defaultPropertyVisitor = DefaultPropertyVisitor;

            _propertyScanner = new EntityTranslateBuilderPropertyScanner <TResult, TInput, TSchema>();
        }
示例#5
0
        public TranslateBuilder(TranslateFactoryContext <TSchema> context)
        {
            _context = context;

            _translators = new Dictionary <Type, IEntityTranslatorList <TSchema> >();
        }