Exemple #1
0
        public Inferrer(IConnectionSettingsValues connectionSettings)
        {
            connectionSettings.ThrowIfNull(nameof(connectionSettings));
            _connectionSettings  = connectionSettings;
            IdResolver           = new IdResolver(connectionSettings);
            IndexNameResolver    = new IndexNameResolver(connectionSettings);
            TypeNameResolver     = new TypeNameResolver(connectionSettings);
            RelationNameResolver = new RelationNameResolver(connectionSettings);
            FieldResolver        = new FieldResolver(connectionSettings);
            RoutingResolver      = new RoutingResolver(connectionSettings, IdResolver);

            Contracts = new ConcurrentDictionary <Type, JsonContract>();
            CreateMultiHitDelegates =
                new ConcurrentDictionary <Type, Action <MultiGetHitJsonConverter.MultiHitTuple, JsonSerializer, ICollection <IMultiGetHit <object> > > >();
            CreateSearchResponseDelegates =
                new ConcurrentDictionary <Type, Action <MultiSearchResponseJsonConverter.SearchHitTuple, JsonSerializer, IDictionary <string, object> >
                                          >();
        }
Exemple #2
0
 public RoutingResolver(IConnectionSettingsValues connectionSettings, IdResolver idResolver)
 {
     _connectionSettings = connectionSettings;
     _idResolver         = idResolver;
 }
Exemple #3
0
 public string Id(Type type, object instance) => IdResolver.Resolve(type, instance);
Exemple #4
0
 public string Id <T>(T instance) where T : class => IdResolver.Resolve(instance);