Ejemplo n.º 1
0
        internal override string GetIdForObject(IdResolver resolver)
        {
            if (!this._Id.IsNullOrEmpty())
            {
                return(this._Id);
            }

            return(resolver.GetIdFor <T>((T)_Object));
        }
Ejemplo n.º 2
0
        public Inferrer(IConnectionSettingsValues connectionSettings)
        {
            connectionSettings.ThrowIfNull(nameof(connectionSettings));
            _connectionSettings  = connectionSettings;
            IdResolver           = new IdResolver(connectionSettings);
            IndexNameResolver    = new IndexNameResolver(connectionSettings);
            RelationNameResolver = new RelationNameResolver(connectionSettings);
            FieldResolver        = new FieldResolver(connectionSettings);
            RoutingResolver      = new RoutingResolver(connectionSettings, IdResolver);

            CreateMultiHitDelegates =
                new ConcurrentDictionary <Type,
                                          Action <MultiGetResponseFormatter.MultiHitTuple, IJsonFormatterResolver, ICollection <IMultiGetHit <object> > > >();
            CreateSearchResponseDelegates =
                new ConcurrentDictionary <Type,
                                          Action <MultiSearchResponseFormatter.SearchHitTuple, IJsonFormatterResolver, IDictionary <string, IResponse> > >();
        }
Ejemplo n.º 3
0
 internal virtual string GetIdForObject(IdResolver resolver)
 {
     return(this._Id);
 }
Ejemplo n.º 4
0
 public string Id(Type type, object instance) => IdResolver.Resolve(type, instance);
Ejemplo n.º 5
0
 public string Id <T>(T instance) where T : class => IdResolver.Resolve(instance);
Ejemplo n.º 6
0
 public RoutingResolver(IConnectionSettingsValues connectionSettings, IdResolver idResolver)
 {
     _connectionSettings = connectionSettings;
     _idResolver         = idResolver;
 }