示例#1
0
        public EntityTranslator(IEntityFactory <TEntity> entityFactory, IReadOnlyList <IPropertyTranslator <TEntity, TInput, TSchema> > propertyTranslaters)
        {
            _entityFactory       = entityFactory;
            _propertyTranslaters = propertyTranslaters;

            _observers = new TranslatorObservable <TSchema>();
        }
示例#2
0
        public Translator(IReadOnlyDictionary <Type, IEntityTranslator <TSchema> > entityTranslators)
        {
            _entityTranslators = entityTranslators;

            _observers = new TranslatorObservable <TSchema>();
            _handles   = _entityTranslators.Values.Select(x => x.ConnectTranslateObserver(_observers)).ToArray();
        }
示例#3
0
        public ExcludeEntityTranslator(TranslateEntityFilter <TEntity, TSchema> filter = null)
        {
            _filter = filter;

            _observers = new TranslatorObservable <TSchema>();
        }