public RestHandler(Func <CancellationToken, Task <HttpResponseMessage> > request, IDeserializerFactory deserializerFactory) { _request = request; _deserializerFactory = deserializerFactory; _сallbacks = new Dictionary <HttpStatusCode, Action <IDeserializer, string> >(); }
public ReceivedMessagesProcessor(IMessagesReceiverService messagesReceiverService, IDeserializerFactory <T> deserializerFactory, ILogger <ReceivedMessagesProcessor <T> > logger) { _messagesReceiverService = messagesReceiverService; _deserializerFactory = deserializerFactory; _logger = logger; }
/// <inheritdoc /> public IConsumer <TKey, TValue> Create <TKey, TValue>( ConsumerConfig config, IConsumerConfigurator configurator, IDeserializerFactory deserializerFactory) => configurator.Configure( new ConsumerBuilder <TKey, TValue>(config), deserializerFactory.Create <TKey>(), deserializerFactory.Create <TValue>()) .Build();
public RequestBuilder(HttpClient client, ISerializer serializer, IDeserializerFactory deserializerFactory, Action <HttpRequestHeaders> headersModifyer) { _client = client; _serializer = serializer; _deserializerFactory = deserializerFactory; _headersModifyer = headersModifyer; }
public DeserializerCollection( IDeserializerFactory deserializerFactory) { if (deserializerFactory == null) { throw new ArgumentNullException(nameof(deserializerFactory)); } _deserializerFactory = deserializerFactory; }
/// <summary> /// Creates a new instance of default API consumer factory. /// </summary> /// <param name="consumerFactory"> /// The native consumer factory. /// </param> /// <param name="consumerConfigurator"> /// The native consumer configurator. /// </param> /// <param name="deserializerFactory"> /// The deserializer factory. /// </param> /// <param name="loggerFactory"> /// The logger factory. /// </param> /// <exception cref="ArgumentNullException"> /// One of arguments is not specified. /// </exception> public DefaultApiConsumerFactory( [NotNull] IConsumerFactory consumerFactory, [NotNull] IConsumerConfigurator consumerConfigurator, [NotNull] IDeserializerFactory deserializerFactory, [NotNull] ILoggerFactory loggerFactory) { _consumerFactory = consumerFactory ?? throw new ArgumentNullException(nameof(consumerFactory)); _consumerConfigurator = consumerConfigurator ?? throw new ArgumentNullException(nameof(consumerConfigurator)); _deserializerFactory = deserializerFactory ?? throw new ArgumentNullException(nameof(deserializerFactory)); _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); }
public HandlerTests() { var deserializerMock = new Mock <IDeserializer>(); deserializerMock.Setup(deserializer => deserializer.ContentType).Returns("application/json"); deserializerMock.Setup(converter => converter.Deserialize <object>(string.Empty)) .Throws <DeserializationException>(); var deserializerFactoryMock = new Mock <IDeserializerFactory>(); deserializerFactoryMock.Setup(factory => factory.GetDeserializer(It.IsAny <string>())) .Returns(deserializerMock.Object); _deserializerFactory = deserializerFactoryMock.Object; }
public BinarySerializer( ISerializerFactory serializerFactory, IDeserializerFactory deserializerFactory) { if (serializerFactory == null) { throw new ArgumentNullException(nameof(serializerFactory)); } if (deserializerFactory == null) { throw new ArgumentNullException(nameof(deserializerFactory)); } _serializerCollection = new SerializerCollection(serializerFactory); _deserializerCollection = new DeserializerCollection(deserializerFactory); }
private void initByAttributes(MemberInfo mi) { DeserializerFactory = mi.GetCustomAttributes(false).OfType <IDeserializerFactory>().SingleOrDefault(); var dmAttr = mi.GetCustomAttribute <DataMemberAttribute>(); if (dmAttr == null) { return; } Required = dmAttr.IsRequired; if (string.IsNullOrWhiteSpace(dmAttr.Name)) { return; } Name = dmAttr.Name; }
public MultipleResultDeserializer(IDeserializerFactory deserializerFactory) { _deserializerFactory = deserializerFactory; _setAccessorFactory = new EmitSetAccessorFactory(); }
/// <summary> /// Deserializes the eventual object into an instance of type <typeparamref name="T"/>. /// </summary> /// <typeparam name="T">The type to deserialize to.</typeparam> /// <param name="deserializerFactory">The deserialization factory to use to create a deserializer.</param> /// <returns>An instance of type <typeparamref name="T"/> obtained from deserializing the state.</returns> public T Deserialize <T>(IDeserializerFactory deserializerFactory) => Deserialize(deserializerFactory.GetDeserializer <T>());
public ResultHandlerMiddleware(SmartSqlConfig smartSqlConfig) { _deserializerFactory = smartSqlConfig.DeserializerFactory; }
public override void SetupSmartSql(SmartSqlBuilder smartSqlBuilder) { _deserializerFactory = smartSqlBuilder.SmartSqlConfig.DeserializerFactory; }
public MultipleResultDeserializer(IDeserializerFactory deserializerFactory) { _deserializerFactory = deserializerFactory; _setAccessorFactory = EmitSetAccessorFactory.Instance; }
public ValueTupleDeserializer(IDeserializerFactory deserializerFactory) { _deserializerFactory = deserializerFactory; }
public UpnpClient(IDeserializerFactory deserializerFactory) { DeserializerFactory = deserializerFactory ?? DeserializerFactory <Deserializer> .Instance; client.ServiceAdded += ClientServiceAdded; client.ServiceRemoved += ClientServiceRemoved; }
public WorkflowParser(IDeserializerFactory deserializerFactory) { _deserializer = deserializerFactory.Get(); }
public void AddDeserializerFactory(IDeserializerFactory f) { m_deserializerFactories.Insert(0, f); }