Beispiel #1
0
 public static IMicroContractResolverBuilder AddStandardContracts(this IMicroContractResolverBuilder builder) =>
 builder
 .AddFactory <BasicJsonContractFactory>()
 .AddFactory <NullableStructJsonContractFactory>()
 .AddFactory <EnumJsonContractFactory>()
 .AddFactory <FlagsEnumJsonContractFactory>()
 .AddFactory <UnionJsonContractFactory>()
 .AddCreator <IPAddress, IpAddressJsonContractCreator>()
 .AddCreator <IPEndPoint, IpEndPointJsonContractCreator>()
 .AddCreator <DnsEndPoint, DnsEndPointJsonContractCreator>()
 .AddMiddlewareFactory <UnionCaseJsonMiddlewareFactory>();
Beispiel #2
0
 public static IMicroContractResolverBuilder AddFactory <T> (this IMicroContractResolverBuilder builder)
     where T : class, IJsonContractFactory, new() =>
 builder.AddFactory(Singleton <T> .instance);