private static async Task <Option <TagsView, Error> > PublishAsyncOrError( TagService.TagServiceClient client, PublishTags command) { try { var result = await client.PublishCollectionAsync(command); return(result.Some <TagsView, Error>()); } catch (RpcException) { return(Option.None <TagsView, Error>( Error.Critical("An unhandled exception occured while publishing the article's tags."))); } }
public TagService.TagServiceClient Create() { //var certificate = new X509Certificate2(_settings.CertFileName, _settings.CertPassword); var handler = new HttpClientHandler(); //handler.ClientCertificates.Add(certificate); var httpClient = new HttpClient(handler); var channelOptions = new GrpcChannelOptions { HttpClient = httpClient, LoggerFactory = _loggerFactory }; var channel = GrpcChannel.ForAddress(_settings.TagsServerUrl, channelOptions); var client = new TagService.TagServiceClient(channel); return(client); }