Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class GrpcServicesExtensions
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class GrpcServicesExtensions
  11. | gRPC for .NET ">
  12. <meta name="generator" content="docfx 2.36.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions">
  73. <h1 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions" class="text-break">Class GrpcServicesExtensions
  74. </h1>
  75. <div class="markdown level0 summary"><p>Extension methods for the gRPC services.</p>
  76. </div>
  77. <div class="markdown level0 conceptual"></div>
  78. <div class="inheritance">
  79. <h5>Inheritance</h5>
  80. <div class="level0"><span class="xref">System.Object</span></div>
  81. <div class="level1"><span class="xref">GrpcServicesExtensions</span></div>
  82. </div>
  83. <h6><strong>Namespace</strong>: <a class="xref" href="Microsoft.Extensions.DependencyInjection.html">Microsoft.Extensions.DependencyInjection</a></h6>
  84. <h6><strong>Assembly</strong>: Grpc.AspNetCore.Server.dll</h6>
  85. <h5 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_syntax">Syntax</h5>
  86. <div class="codewrapper">
  87. <pre><code class="lang-csharp hljs">public static class GrpcServicesExtensions : object</code></pre>
  88. </div>
  89. <h3 id="methods">Methods
  90. </h3>
  91. <a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc*"></a>
  92. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_IServiceCollection_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc(IServiceCollection)">AddGrpc(IServiceCollection)</h4>
  93. <div class="markdown level1 summary"><p>Adds gRPC services to the specified <see cref="!:IServiceCollection"></see>.</p>
  94. </div>
  95. <div class="markdown level1 conceptual"></div>
  96. <h5 class="decalaration">Declaration</h5>
  97. <div class="codewrapper">
  98. <pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddGrpc(this IServiceCollection services)</code></pre>
  99. </div>
  100. <h5 class="parameters">Parameters</h5>
  101. <table class="table table-bordered table-striped table-condensed">
  102. <thead>
  103. <tr>
  104. <th>Type</th>
  105. <th>Name</th>
  106. <th>Description</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <tr>
  111. <td><span class="xref">IServiceCollection</span></td>
  112. <td><span class="parametername">services</span></td>
  113. <td><p>The <see cref="!:IServiceCollection"></see> for adding services.</p>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. <h5 class="returns">Returns</h5>
  119. <table class="table table-bordered table-striped table-condensed">
  120. <thead>
  121. <tr>
  122. <th>Type</th>
  123. <th>Description</th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. <tr>
  128. <td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
  129. <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>
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddGrpc_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddGrpc*"></a>
  135. <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>
  136. <div class="markdown level1 summary"><p>Adds gRPC services to the specified <see cref="!:IServiceCollection"></see>.</p>
  137. </div>
  138. <div class="markdown level1 conceptual"></div>
  139. <h5 class="decalaration">Declaration</h5>
  140. <div class="codewrapper">
  141. <pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddGrpc(this IServiceCollection services, Action&lt;GrpcServiceOptions&gt; configureOptions)</code></pre>
  142. </div>
  143. <h5 class="parameters">Parameters</h5>
  144. <table class="table table-bordered table-striped table-condensed">
  145. <thead>
  146. <tr>
  147. <th>Type</th>
  148. <th>Name</th>
  149. <th>Description</th>
  150. </tr>
  151. </thead>
  152. <tbody>
  153. <tr>
  154. <td><span class="xref">IServiceCollection</span></td>
  155. <td><span class="parametername">services</span></td>
  156. <td><p>The <see cref="!:IServiceCollection"></see> for adding services.</p>
  157. </td>
  158. </tr>
  159. <tr>
  160. <td><span class="xref">Action</span>&lt;<a class="xref" href="Grpc.AspNetCore.Server.GrpcServiceOptions.html">GrpcServiceOptions</a>&gt;</td>
  161. <td><span class="parametername">configureOptions</span></td>
  162. <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>
  163. </td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <h5 class="returns">Returns</h5>
  168. <table class="table table-bordered table-striped table-condensed">
  169. <thead>
  170. <tr>
  171. <th>Type</th>
  172. <th>Description</th>
  173. </tr>
  174. </thead>
  175. <tbody>
  176. <tr>
  177. <td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
  178. <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>
  179. </td>
  180. </tr>
  181. </tbody>
  182. </table>
  183. <a id="Microsoft_Extensions_DependencyInjection_GrpcServicesExtensions_AddServiceOptions_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcServicesExtensions.AddServiceOptions*"></a>
  184. <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>
  185. <div class="markdown level1 summary"><p>Adds service specific options to an <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a>.</p>
  186. </div>
  187. <div class="markdown level1 conceptual"></div>
  188. <h5 class="decalaration">Declaration</h5>
  189. <div class="codewrapper">
  190. <pre><code class="lang-csharp hljs">public static IGrpcServerBuilder AddServiceOptions&lt;TService&gt;(this IGrpcServerBuilder grpcBuilder, Action&lt;GrpcServiceOptions&lt;TService&gt;&gt; configure)
  191. where TService : class</code></pre>
  192. </div>
  193. <h5 class="parameters">Parameters</h5>
  194. <table class="table table-bordered table-striped table-condensed">
  195. <thead>
  196. <tr>
  197. <th>Type</th>
  198. <th>Name</th>
  199. <th>Description</th>
  200. </tr>
  201. </thead>
  202. <tbody>
  203. <tr>
  204. <td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
  205. <td><span class="parametername">grpcBuilder</span></td>
  206. <td><p>The <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a>.</p>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td><span class="xref">Action</span>&lt;<a class="xref" href="Grpc.AspNetCore.Server.GrpcServiceOptions-1.html">GrpcServiceOptions</a>&lt;TService&gt;&gt;</td>
  211. <td><span class="parametername">configure</span></td>
  212. <td><p>A callback to configure the service options.</p>
  213. </td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <h5 class="returns">Returns</h5>
  218. <table class="table table-bordered table-striped table-condensed">
  219. <thead>
  220. <tr>
  221. <th>Type</th>
  222. <th>Description</th>
  223. </tr>
  224. </thead>
  225. <tbody>
  226. <tr>
  227. <td><a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a></td>
  228. <td><p>The same instance of the <a class="xref" href="Grpc.AspNetCore.Server.IGrpcServerBuilder.html">IGrpcServerBuilder</a> for chaining.</p>
  229. </td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. <h5 class="typeParameters">Type Parameters</h5>
  234. <table class="table table-bordered table-striped table-condensed">
  235. <thead>
  236. <tr>
  237. <th>Name</th>
  238. <th>Description</th>
  239. </tr>
  240. </thead>
  241. <tbody>
  242. <tr>
  243. <td><span class="parametername">TService</span></td>
  244. <td><p>The service type to configure.</p>
  245. </td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. </article>
  250. </div>
  251. <div class="hidden-sm col-md-2" role="complementary">
  252. <div class="sideaffix">
  253. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  254. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  255. </nav>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. <footer>
  261. <div class="grad-bottom"></div>
  262. <div class="footer">
  263. <div class="container">
  264. <span class="pull-right">
  265. <a href="#top">Back to top</a>
  266. </span>
  267. <span>Generated by <strong>DocFX</strong></span>
  268. </div>
  269. </div>
  270. </footer>
  271. </div>
  272. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  273. <script type="text/javascript" src="../styles/docfx.js"></script>
  274. <script type="text/javascript" src="../styles/main.js"></script>
  275. </body>
  276. </html>