public GeneratedSerializerTests() { _serviceProvider = new ServiceCollection() .AddHagar(hagar => hagar.AddAssembly(typeof(GeneratedSerializerTests).Assembly)) .BuildServiceProvider(); _codecProvider = _serviceProvider.GetRequiredService <ITypedCodecProvider>(); _sessionPool = _serviceProvider.GetRequiredService <SerializerSessionPool>(); }
public GeneratedSerializerTests() { this.serviceProvider = new ServiceCollection() .AddHagar() .AddSerializers(typeof(GeneratedSerializerTests).Assembly) .BuildServiceProvider(); this.codecProvider = this.serviceProvider.GetRequiredService <ITypedCodecProvider>(); this.sessionPool = this.serviceProvider.GetRequiredService <SessionPool>(); }
public FieldCodecHolder(ITypedCodecProvider codecProvider) { this.codecProvider = codecProvider; }
public Serializer(ITypedCodecProvider codecProvider) { this.expectedType = typeof(T); this.codec = HagarGeneratedCodeHelper.UnwrapService(null, codecProvider.GetCodec <T>()); }
public Serializer(ITypedCodecProvider codecProvider) { this.CodecProvider = codecProvider; this.codec = codecProvider.GetCodec <T>(); }