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