grpc/csharp-dotnet/api/Microsoft.Extensions.Depend...

292 lines
13 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class GrpcServicesExtensions
| gRPC for .NET </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class GrpcServicesExtensions
| gRPC for .NET ">
<meta name="generator" content="docfx 2.36.0.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions">
<h1 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions" class="text-break">Class GrpcServicesExtensions
</h1>
<div class="markdown level0 summary"><p>Extension methods for the gRPC services.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">GrpcServicesExtensions</span></div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Microsoft.Extensions.DependencyInjection.html">Microsoft.Extensions.DependencyInjection</a></h6>
<h6><strong>Assembly</strong>: Grpc.AspNetCore.Server.dll</h6>
<h5 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class GrpcServicesExtensions : object</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc*"></a>
<h4 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_IServiceCollection_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc(IServiceCollection)">AddGrpc(IServiceCollection)</h4>
<div class="markdown level1 summary"><p>Adds gRPC services to the specified <see cref="!:IServiceCollection"></see>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddGrpc(this IServiceCollection services)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IServiceCollection</span></td>
<td><span class="parametername">services</span></td>
<td><p>The <see cref="!:IServiceCollection"></see> for adding services.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
<td><p>An <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a> that can be used to further configure the gRPC services.</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc*"></a>
<h4 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_IServiceCollection_Action_Grpc_AspNetCore_Server_GrpcServiceOptions__" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc(IServiceCollection,Action{Grpc.AspNetCore.Server.GrpcServiceOptions})">AddGrpc(IServiceCollection, Action&lt;GrpcServiceOptions&gt;)</h4>
<div class="markdown level1 summary"><p>Adds gRPC services to the specified <see cref="!:IServiceCollection"></see>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddGrpc(this IServiceCollection services, Action&lt;GrpcServiceOptions&gt; configureOptions)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">IServiceCollection</span></td>
<td><span class="parametername">services</span></td>
<td><p>The <see cref="!:IServiceCollection"></see> for adding services.</p>
</td>
</tr>
<tr>
<td><span class="xref">Action</span>&lt;<a class="xref" href="Grpc.AspNetCore.Server.GrpcServiceOptions.html">GrpcServiceOptions</a>&gt;</td>
<td><span class="parametername">configureOptions</span></td>
<td><p>An <see cref="!:Action&lt;GrpcServiceOptions>"></see> to configure the provided <a class="xref" href="Grpc.AspNetCore.Server.GrpcServiceOptions.html">GrpcServiceOptions</a>.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
<td><p>An <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a> that can be used to further configure the gRPC services.</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddServiceOptions_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddServiceOptions*"></a>
<h4 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddServiceOptions__1_Grpc_AspNetCore_Server_IGrpcServerBuilder_Action_Grpc_AspNetCore_Server_GrpcServiceOptions___0___" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddServiceOptions``1(Grpc.AspNetCore.Server.IGrpcServerBuilder,Action{Grpc.AspNetCore.Server.GrpcServiceOptions{``0}})">AddServiceOptions&lt;TService&gt;(IGrpcServerBuilder, Action&lt;GrpcServiceOptions&lt;TService&gt;&gt;)</h4>
<div class="markdown level1 summary"><p>Adds service specific options to an <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddServiceOptions&lt;TService&gt;(this IGrpcServerBuilder grpcBuilder, Action&lt;GrpcServiceOptions&lt;TService&gt;&gt; configure)
where TService : class</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
<td><span class="parametername">grpcBuilder</span></td>
<td><p>The <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a>.</p>
</td>
</tr>
<tr>
<td><span class="xref">Action</span>&lt;<a class="xref" href="Grpc.AspNetCore.Server.GrpcServiceOptions-1.html">GrpcServiceOptions</a>&lt;TService&gt;&gt;</td>
<td><span class="parametername">configure</span></td>
<td><p>A callback to configure the service options.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
<td><p>The same instance of the <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a> for chaining.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">TService</span></td>
<td><p>The service type to configure.</p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>