Grpc.Core.ServerServiceDefinition.Builder.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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 ServerServiceDefinition.Builder
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class ServerServiceDefinition.Builder
  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="Grpc.Core.ServerServiceDefinition.Builder">
  73. <h1 id="Grpc_Core_ServerServiceDefinition_Builder" data-uid="Grpc.Core.ServerServiceDefinition.Builder" class="text-break">Class ServerServiceDefinition.Builder
  74. </h1>
  75. <div class="markdown level0 summary"><p>Builder class for <a class="xref" href="Grpc.Core.ServerServiceDefinition.html">ServerServiceDefinition</a>.</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">ServerServiceDefinition.Builder</span></div>
  82. </div>
  83. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  84. <h6><strong>Assembly</strong>: Grpc.Core.Api.dll</h6>
  85. <h5 id="Grpc_Core_ServerServiceDefinition_Builder_syntax">Syntax</h5>
  86. <div class="codewrapper">
  87. <pre><code class="lang-csharp hljs">public class Builder : object</code></pre>
  88. </div>
  89. <h3 id="constructors">Constructors
  90. </h3>
  91. <a id="Grpc_Core_ServerServiceDefinition_Builder__ctor_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.#ctor*"></a>
  92. <h4 id="Grpc_Core_ServerServiceDefinition_Builder__ctor" data-uid="Grpc.Core.ServerServiceDefinition.Builder.#ctor">Builder()</h4>
  93. <div class="markdown level1 summary"><p>Creates a new instance of builder.</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 Builder()</code></pre>
  99. </div>
  100. <h3 id="methods">Methods
  101. </h3>
  102. <a id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod*"></a>
  103. <h4 id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod__2_Grpc_Core_Method___0___1__Grpc_Core_ClientStreamingServerMethod___0___1__" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod``2(Grpc.Core.Method{``0,``1},Grpc.Core.ClientStreamingServerMethod{``0,``1})">AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt;, ClientStreamingServerMethod&lt;TRequest, TResponse&gt;)</h4>
  104. <div class="markdown level1 summary"><p>Adds a definition for a client streaming method.</p>
  105. </div>
  106. <div class="markdown level1 conceptual"></div>
  107. <h5 class="decalaration">Declaration</h5>
  108. <div class="codewrapper">
  109. <pre><code class="lang-csharp hljs">public ServerServiceDefinition.Builder AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt; method, ClientStreamingServerMethod&lt;TRequest, TResponse&gt; handler)
  110. where TRequest : class where TResponse : class</code></pre>
  111. </div>
  112. <h5 class="parameters">Parameters</h5>
  113. <table class="table table-bordered table-striped table-condensed">
  114. <thead>
  115. <tr>
  116. <th>Type</th>
  117. <th>Name</th>
  118. <th>Description</th>
  119. </tr>
  120. </thead>
  121. <tbody>
  122. <tr>
  123. <td><a class="xref" href="Grpc.Core.Method-2.html">Method</a>&lt;TRequest, TResponse&gt;</td>
  124. <td><span class="parametername">method</span></td>
  125. <td><p>The method.</p>
  126. </td>
  127. </tr>
  128. <tr>
  129. <td><a class="xref" href="Grpc.Core.ClientStreamingServerMethod-2.html">ClientStreamingServerMethod</a>&lt;TRequest, TResponse&gt;</td>
  130. <td><span class="parametername">handler</span></td>
  131. <td><p>The method handler.</p>
  132. </td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. <h5 class="returns">Returns</h5>
  137. <table class="table table-bordered table-striped table-condensed">
  138. <thead>
  139. <tr>
  140. <th>Type</th>
  141. <th>Description</th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. <tr>
  146. <td><a class="xref" href="Grpc.Core.ServerServiceDefinition.Builder.html">ServerServiceDefinition.Builder</a></td>
  147. <td><p>This builder instance.</p>
  148. </td>
  149. </tr>
  150. </tbody>
  151. </table>
  152. <h5 class="typeParameters">Type Parameters</h5>
  153. <table class="table table-bordered table-striped table-condensed">
  154. <thead>
  155. <tr>
  156. <th>Name</th>
  157. <th>Description</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr>
  162. <td><span class="parametername">TRequest</span></td>
  163. <td><p>The request message class.</p>
  164. </td>
  165. </tr>
  166. <tr>
  167. <td><span class="parametername">TResponse</span></td>
  168. <td><p>The response message class.</p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <a id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod*"></a>
  174. <h4 id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod__2_Grpc_Core_Method___0___1__Grpc_Core_DuplexStreamingServerMethod___0___1__" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod``2(Grpc.Core.Method{``0,``1},Grpc.Core.DuplexStreamingServerMethod{``0,``1})">AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt;, DuplexStreamingServerMethod&lt;TRequest, TResponse&gt;)</h4>
  175. <div class="markdown level1 summary"><p>Adds a definition for a bidirectional streaming method.</p>
  176. </div>
  177. <div class="markdown level1 conceptual"></div>
  178. <h5 class="decalaration">Declaration</h5>
  179. <div class="codewrapper">
  180. <pre><code class="lang-csharp hljs">public ServerServiceDefinition.Builder AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt; method, DuplexStreamingServerMethod&lt;TRequest, TResponse&gt; handler)
  181. where TRequest : class where TResponse : class</code></pre>
  182. </div>
  183. <h5 class="parameters">Parameters</h5>
  184. <table class="table table-bordered table-striped table-condensed">
  185. <thead>
  186. <tr>
  187. <th>Type</th>
  188. <th>Name</th>
  189. <th>Description</th>
  190. </tr>
  191. </thead>
  192. <tbody>
  193. <tr>
  194. <td><a class="xref" href="Grpc.Core.Method-2.html">Method</a>&lt;TRequest, TResponse&gt;</td>
  195. <td><span class="parametername">method</span></td>
  196. <td><p>The method.</p>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td><a class="xref" href="Grpc.Core.DuplexStreamingServerMethod-2.html">DuplexStreamingServerMethod</a>&lt;TRequest, TResponse&gt;</td>
  201. <td><span class="parametername">handler</span></td>
  202. <td><p>The method handler.</p>
  203. </td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. <h5 class="returns">Returns</h5>
  208. <table class="table table-bordered table-striped table-condensed">
  209. <thead>
  210. <tr>
  211. <th>Type</th>
  212. <th>Description</th>
  213. </tr>
  214. </thead>
  215. <tbody>
  216. <tr>
  217. <td><a class="xref" href="Grpc.Core.ServerServiceDefinition.Builder.html">ServerServiceDefinition.Builder</a></td>
  218. <td><p>This builder instance.</p>
  219. </td>
  220. </tr>
  221. </tbody>
  222. </table>
  223. <h5 class="typeParameters">Type Parameters</h5>
  224. <table class="table table-bordered table-striped table-condensed">
  225. <thead>
  226. <tr>
  227. <th>Name</th>
  228. <th>Description</th>
  229. </tr>
  230. </thead>
  231. <tbody>
  232. <tr>
  233. <td><span class="parametername">TRequest</span></td>
  234. <td><p>The request message class.</p>
  235. </td>
  236. </tr>
  237. <tr>
  238. <td><span class="parametername">TResponse</span></td>
  239. <td><p>The response message class.</p>
  240. </td>
  241. </tr>
  242. </tbody>
  243. </table>
  244. <a id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod*"></a>
  245. <h4 id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod__2_Grpc_Core_Method___0___1__Grpc_Core_ServerStreamingServerMethod___0___1__" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod``2(Grpc.Core.Method{``0,``1},Grpc.Core.ServerStreamingServerMethod{``0,``1})">AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt;, ServerStreamingServerMethod&lt;TRequest, TResponse&gt;)</h4>
  246. <div class="markdown level1 summary"><p>Adds a definition for a server streaming method.</p>
  247. </div>
  248. <div class="markdown level1 conceptual"></div>
  249. <h5 class="decalaration">Declaration</h5>
  250. <div class="codewrapper">
  251. <pre><code class="lang-csharp hljs">public ServerServiceDefinition.Builder AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt; method, ServerStreamingServerMethod&lt;TRequest, TResponse&gt; handler)
  252. where TRequest : class where TResponse : class</code></pre>
  253. </div>
  254. <h5 class="parameters">Parameters</h5>
  255. <table class="table table-bordered table-striped table-condensed">
  256. <thead>
  257. <tr>
  258. <th>Type</th>
  259. <th>Name</th>
  260. <th>Description</th>
  261. </tr>
  262. </thead>
  263. <tbody>
  264. <tr>
  265. <td><a class="xref" href="Grpc.Core.Method-2.html">Method</a>&lt;TRequest, TResponse&gt;</td>
  266. <td><span class="parametername">method</span></td>
  267. <td><p>The method.</p>
  268. </td>
  269. </tr>
  270. <tr>
  271. <td><a class="xref" href="Grpc.Core.ServerStreamingServerMethod-2.html">ServerStreamingServerMethod</a>&lt;TRequest, TResponse&gt;</td>
  272. <td><span class="parametername">handler</span></td>
  273. <td><p>The method handler.</p>
  274. </td>
  275. </tr>
  276. </tbody>
  277. </table>
  278. <h5 class="returns">Returns</h5>
  279. <table class="table table-bordered table-striped table-condensed">
  280. <thead>
  281. <tr>
  282. <th>Type</th>
  283. <th>Description</th>
  284. </tr>
  285. </thead>
  286. <tbody>
  287. <tr>
  288. <td><a class="xref" href="Grpc.Core.ServerServiceDefinition.Builder.html">ServerServiceDefinition.Builder</a></td>
  289. <td><p>This builder instance.</p>
  290. </td>
  291. </tr>
  292. </tbody>
  293. </table>
  294. <h5 class="typeParameters">Type Parameters</h5>
  295. <table class="table table-bordered table-striped table-condensed">
  296. <thead>
  297. <tr>
  298. <th>Name</th>
  299. <th>Description</th>
  300. </tr>
  301. </thead>
  302. <tbody>
  303. <tr>
  304. <td><span class="parametername">TRequest</span></td>
  305. <td><p>The request message class.</p>
  306. </td>
  307. </tr>
  308. <tr>
  309. <td><span class="parametername">TResponse</span></td>
  310. <td><p>The response message class.</p>
  311. </td>
  312. </tr>
  313. </tbody>
  314. </table>
  315. <a id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod*"></a>
  316. <h4 id="Grpc_Core_ServerServiceDefinition_Builder_AddMethod__2_Grpc_Core_Method___0___1__Grpc_Core_UnaryServerMethod___0___1__" data-uid="Grpc.Core.ServerServiceDefinition.Builder.AddMethod``2(Grpc.Core.Method{``0,``1},Grpc.Core.UnaryServerMethod{``0,``1})">AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt;, UnaryServerMethod&lt;TRequest, TResponse&gt;)</h4>
  317. <div class="markdown level1 summary"><p>Adds a definition for a single request - single response method.</p>
  318. </div>
  319. <div class="markdown level1 conceptual"></div>
  320. <h5 class="decalaration">Declaration</h5>
  321. <div class="codewrapper">
  322. <pre><code class="lang-csharp hljs">public ServerServiceDefinition.Builder AddMethod&lt;TRequest, TResponse&gt;(Method&lt;TRequest, TResponse&gt; method, UnaryServerMethod&lt;TRequest, TResponse&gt; handler)
  323. where TRequest : class where TResponse : class</code></pre>
  324. </div>
  325. <h5 class="parameters">Parameters</h5>
  326. <table class="table table-bordered table-striped table-condensed">
  327. <thead>
  328. <tr>
  329. <th>Type</th>
  330. <th>Name</th>
  331. <th>Description</th>
  332. </tr>
  333. </thead>
  334. <tbody>
  335. <tr>
  336. <td><a class="xref" href="Grpc.Core.Method-2.html">Method</a>&lt;TRequest, TResponse&gt;</td>
  337. <td><span class="parametername">method</span></td>
  338. <td><p>The method.</p>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td><a class="xref" href="Grpc.Core.UnaryServerMethod-2.html">UnaryServerMethod</a>&lt;TRequest, TResponse&gt;</td>
  343. <td><span class="parametername">handler</span></td>
  344. <td><p>The method handler.</p>
  345. </td>
  346. </tr>
  347. </tbody>
  348. </table>
  349. <h5 class="returns">Returns</h5>
  350. <table class="table table-bordered table-striped table-condensed">
  351. <thead>
  352. <tr>
  353. <th>Type</th>
  354. <th>Description</th>
  355. </tr>
  356. </thead>
  357. <tbody>
  358. <tr>
  359. <td><a class="xref" href="Grpc.Core.ServerServiceDefinition.Builder.html">ServerServiceDefinition.Builder</a></td>
  360. <td><p>This builder instance.</p>
  361. </td>
  362. </tr>
  363. </tbody>
  364. </table>
  365. <h5 class="typeParameters">Type Parameters</h5>
  366. <table class="table table-bordered table-striped table-condensed">
  367. <thead>
  368. <tr>
  369. <th>Name</th>
  370. <th>Description</th>
  371. </tr>
  372. </thead>
  373. <tbody>
  374. <tr>
  375. <td><span class="parametername">TRequest</span></td>
  376. <td><p>The request message class.</p>
  377. </td>
  378. </tr>
  379. <tr>
  380. <td><span class="parametername">TResponse</span></td>
  381. <td><p>The response message class.</p>
  382. </td>
  383. </tr>
  384. </tbody>
  385. </table>
  386. <a id="Grpc_Core_ServerServiceDefinition_Builder_Build_" data-uid="Grpc.Core.ServerServiceDefinition.Builder.Build*"></a>
  387. <h4 id="Grpc_Core_ServerServiceDefinition_Builder_Build" data-uid="Grpc.Core.ServerServiceDefinition.Builder.Build">Build()</h4>
  388. <div class="markdown level1 summary"><p>Creates an immutable <code>ServerServiceDefinition</code> from this builder.</p>
  389. </div>
  390. <div class="markdown level1 conceptual"></div>
  391. <h5 class="decalaration">Declaration</h5>
  392. <div class="codewrapper">
  393. <pre><code class="lang-csharp hljs">public ServerServiceDefinition Build()</code></pre>
  394. </div>
  395. <h5 class="returns">Returns</h5>
  396. <table class="table table-bordered table-striped table-condensed">
  397. <thead>
  398. <tr>
  399. <th>Type</th>
  400. <th>Description</th>
  401. </tr>
  402. </thead>
  403. <tbody>
  404. <tr>
  405. <td><a class="xref" href="Grpc.Core.ServerServiceDefinition.html">ServerServiceDefinition</a></td>
  406. <td><p>The <code>ServerServiceDefinition</code> object.</p>
  407. </td>
  408. </tr>
  409. </tbody>
  410. </table>
  411. </article>
  412. </div>
  413. <div class="hidden-sm col-md-2" role="complementary">
  414. <div class="sideaffix">
  415. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  416. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  417. </nav>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. <footer>
  423. <div class="grad-bottom"></div>
  424. <div class="footer">
  425. <div class="container">
  426. <span class="pull-right">
  427. <a href="#top">Back to top</a>
  428. </span>
  429. <span>Generated by <strong>DocFX</strong></span>
  430. </div>
  431. </div>
  432. </footer>
  433. </div>
  434. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  435. <script type="text/javascript" src="../styles/docfx.js"></script>
  436. <script type="text/javascript" src="../styles/main.js"></script>
  437. </body>
  438. </html>