예제 #1
0
        protected RpcServiceStubBuilder(RpcServiceInfo serviceInfo, RpcServiceOptions <TService>?options)
        {
            this.ServiceInfo = serviceInfo ?? throw new ArgumentNullException(nameof(serviceInfo));

            this.Options = options;

            var converterAttributes = serviceInfo.Type.GetCustomAttributes <RpcFaultConverterAttribute>();
            var exceptionConverters = RetrieveServerExceptionConverters(converterAttributes);

            var faultAttributes = serviceInfo.Type.GetCustomAttributes <RpcFaultAttribute>();
            var mappings        = GetFaultToDetailsMapping(faultAttributes);

            if (exceptionConverters.Count > 0 || mappings.Count > 0)
            {
                this.FaultHandler = new RpcServerFaultHandler(null, exceptionConverters, mappings);
            }
            else
            {
                this.FaultHandler = RpcServerFaultHandler.Default;
            }
        }
예제 #2
0
 public GrpcServiceStubBuilder(RpcServiceInfo serviceInfo, RpcServiceOptions <TService>?options) : base(serviceInfo, options)
 {
 }
예제 #3
0
 public GrpcServiceStubBuilder(RpcServiceOptions <TService>?options) :
     this(RpcBuilderUtil.GetServiceInfoFromType(typeof(TService)), options)
 {
 }