{"id":890,"date":"2023-03-11T18:54:31","date_gmt":"2023-03-11T11:54:31","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=890"},"modified":"2023-03-11T19:10:25","modified_gmt":"2023-03-11T12:10:25","slug":"csharp-autoresetevent","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-concurrency\/csharp-autoresetevent\/","title":{"rendered":"C# AutoResetEvent"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the C# <code>AutoResetEvent<\/code> class to synchronize threads and control their executions by signaling events between them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the C# AutoResetEvent class<\/h2>\n\n\n\n<p>The <code>AutoResetEvent<\/code> class allows multiple threads to communicate with each other by signaling events.<\/p>\n\n\n\n<p>An <code>AutoResetEvent<\/code> has two states:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Signaled<\/li>\n\n\n\n<li>Non-signaled<\/li>\n<\/ul>\n\n\n\n<p>When an <code>AutoResetEvent<\/code> object is signaled, a single waiting thread will be released and continues its execution.<\/p>\n\n\n\n<p>However, when an <code><code>AutoResetEvent<\/code><\/code> object is Unsignaled, the waiting thread will be blocked until the <code><code>AutoResetEvent<\/code><\/code> becomes signaled again.<\/p>\n\n\n\n<p>The <code>AutoResetEvent<\/code> object has two main methods that control its state: <code>Waitone()<\/code> and <code>Set()<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>WaitOne()<\/code> method blocks the current thread until the <code>AutoResetEvent<\/code> is signaled or a timeout interval has elapsed.<\/li>\n\n\n\n<li>The <code>Set()<\/code> method changed the state of the <code>AutoResetEvent<\/code> to non-signaled and releases a single waiting thread.<\/li>\n<\/ul>\n\n\n\n<p>In practice, you use the <code>AutoResetEvent<\/code> in multithreaded applications where one thread needs to wait for another thread to complete its work before continuing.<\/p>\n\n\n\n<p>For example, in a producer-consumer scenario, the consumer thread may wait for the producer thread to produce the data before the consumer thread can consume the data.<\/p>\n\n\n\n<p>To use the <code>AutoResetEvent<\/code> class, you can follow these steps:<\/p>\n\n\n\n<p>First, create an <code>AutoResetEvent<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">var<\/span> autoResetEvent = <span class=\"hljs-keyword\">new<\/span> AutoResetEvent(<span class=\"hljs-literal\">false<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The parameter false sets the state of the <code>AutoResetEvent<\/code> object to Unsignaled.<\/p>\n\n\n\n<p>Second, create one thread that waits for the event to be signaled:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">var<\/span> t = <span class=\"hljs-keyword\">new<\/span> Thread(() =&gt;\n{\n    <span class=\"hljs-comment\">\/\/ do some work<\/span>\n    <span class=\"hljs-comment\">\/\/ ...<\/span>\n    <span class=\"hljs-comment\">\/\/ wait for the event to be signaled<\/span>\n    autoResetEvent.WaitOne(); \n    \n    <span class=\"hljs-comment\">\/\/ continue execution after the event is signaled<\/span>\n    <span class=\"hljs-comment\">\/\/ do something else<\/span>\n});<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, starts the thread:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">t.Start();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Fourth, do some operations before the thread can continue to execute and signal the <code>AutoResetEvent<\/code> by calling the <code>Set()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">autoResetEvent.Set();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>Set()<\/code> method changes the state of the <code>AutoResetEvent<\/code> to signaled. As the result, the waiting thread (t) is released and continues the execution until the next call of the <code>WaitOne()<\/code> method.  <\/p>\n\n\n\n<p>Once the thread is released, the <code>AutoResetEvent<\/code> is automatically reset to the Non-signaled state.<\/p>\n\n\n\n<p>Notice that the <code>AutoResetEvent<\/code> will be reset automatically after releasing a single waiting thread. To release multiple waiting threads, you need to call the <code>Set()<\/code> method for each waiting thread or use the <code>ManualResetEvent<\/code> class instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C# AutoResetEvent class example<\/h2>\n\n\n\n<p>The following program demonstrates how the <code>AutoResetEvent<\/code> works:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> autoResetEvent = <span class=\"hljs-keyword\">new<\/span> AutoResetEvent(<span class=\"hljs-literal\">false<\/span>);\n\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">DoWork<\/span>(<span class=\"hljs-params\"><\/span>)<\/span>\n{\n    WriteLine(<span class=\"hljs-string\">$\"Thread <span class=\"hljs-subst\">{Thread.CurrentThread.ManagedThreadId}<\/span> is waiting for the event to be signaled...\"<\/span>);\n\n    <span class=\"hljs-comment\">\/\/ Wait for the event to be signaled<\/span>\n    autoResetEvent.WaitOne();\n\n    WriteLine(<span class=\"hljs-string\">$\"Thread <span class=\"hljs-subst\">{Thread.CurrentThread.ManagedThreadId}<\/span> has been signaled and has resumed execution.\"<\/span>);\n}\n\n<span class=\"hljs-comment\">\/\/ Create a thread that wait for the event to be signaled and start it<\/span>\n<span class=\"hljs-keyword\">var<\/span> t = <span class=\"hljs-keyword\">new<\/span> Thread(() =&gt; DoWork());\nt.Start();\n\n<span class=\"hljs-comment\">\/\/ Wait for 1s to let the thread runs for a while <\/span>\nThread.Sleep(<span class=\"hljs-number\">1000<\/span>);\n\n<span class=\"hljs-comment\">\/\/ Wait for 2s before signaling the event<\/span>\nWriteLine(<span class=\"hljs-string\">\"Waiting for 2 seconds before signaling the event...\"<\/span>);\nThread.Sleep(<span class=\"hljs-number\">2000<\/span>);\n\n\n<span class=\"hljs-comment\">\/\/ Signal the event<\/span>\nautoResetEvent.Set();\n\n<span class=\"hljs-comment\">\/\/ Wait for the threads to finish<\/span>\nt.Join();\n\nWriteLine(<span class=\"hljs-string\">\"Press any key to exit.\"<\/span>);\nReadKey();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How it works.<\/p>\n\n\n\n<p>First, create a new <code>AutoResetEvent<\/code> object and initialize it with false, denoting that the event is not signaled initially:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">var<\/span> autoResetEvent = <span class=\"hljs-keyword\">new<\/span> AutoResetEvent(<span class=\"hljs-literal\">false<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, define the <code>DoWork()<\/code> method that represents the operation that a thread will perform:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">DoWork<\/span>(<span class=\"hljs-params\"><\/span>)<\/span>\n{\n    WriteLine(<span class=\"hljs-string\">$\"Thread <span class=\"hljs-subst\">{Thread.CurrentThread.ManagedThreadId}<\/span> is waiting for the event to be signaled...\"<\/span>);\n\n    <span class=\"hljs-comment\">\/\/ Wait for the event to be signaled<\/span>\n    autoResetEvent.WaitOne();\n\n    WriteLine(<span class=\"hljs-string\">$\"Thread <span class=\"hljs-subst\">{Thread.CurrentThread.ManagedThreadId}<\/span> has been signaled and has resumed execution.\"<\/span>);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>DoWork()<\/code> method writes a message to the console indicating that the thread is waiting for the event to be signaled. It then calls the <code>WaitOne()<\/code> method of the <code>AutoResetEvent<\/code> object to wait for the event to be signaled. <\/p>\n\n\n\n<p>The <code>WaitOne()<\/code> method blocks the thread that executes the <code>DoWork()<\/code> method until the <code>AutoResetEvent<\/code> object becomes signaled.<\/p>\n\n\n\n<p>When the <code>AutoResetEvent<\/code> is signaled, the method resumes its execution that writes another message to the console.<\/p>\n\n\n\n<p>Third, create and start a new thread that executes the <code>DoWork()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">var<\/span> t = <span class=\"hljs-keyword\">new<\/span> Thread(() =&gt; DoWork());\nt.Start();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Fourth, wait for one second to leave enough time for the thread t to run until the <code>WaitOne()<\/code> method is called:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Thread.Sleep(<span class=\"hljs-number\">1000<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Fifth, write a message to the console and wait for two seconds before signaling the event: <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">WriteLine(<span class=\"hljs-string\">\"Waiting for 2 seconds before signaling the event...\"<\/span>);\nThread.Sleep(<span class=\"hljs-number\">2000<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Sixth, change the state of the <code><code>AutoResetEvent<\/code><\/code> object to be signaled by calling the <code>Set()<\/code> method of the <code><code>AutoResetEvent<\/code><\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">autoResetEvent.Set();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>At this moment, the thread that executes the <code>DoWork<\/code> resumes its execution and displays a message to the console.<\/p>\n\n\n\n<p>Seventh, wait for the thread to complete by calling the <code>Join()<\/code> method of the Thread class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">t.Join();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, wait for the user to press any key to exit the program:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">WriteLine(<span class=\"hljs-string\">\"Press any key to exit.\"<\/span>);\nReadKey();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following example shows the output of the program:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Thread <span class=\"hljs-number\">9<\/span> <span class=\"hljs-keyword\">is<\/span> waiting <span class=\"hljs-keyword\">for<\/span> the <span class=\"hljs-keyword\">event<\/span> to be signaled...\nWaiting <span class=\"hljs-keyword\">for<\/span> <span class=\"hljs-number\">2<\/span> seconds before signaling the <span class=\"hljs-keyword\">event<\/span>...\nThread <span class=\"hljs-number\">9<\/span> has been signaled and has resumed execution.\nPress any key to exit.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the C# <code>AutoResetEvent<\/code> class to synchronize threads and control their executions by signaling events between them.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"890\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-concurrency\/csharp-autoresetevent\/\"\n\t\t\t\tdata-post-title=\"C# AutoResetEvent\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"890\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-concurrency\/csharp-autoresetevent\/\"\n\t\t\t\tdata-post-title=\"C# AutoResetEvent\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you&#8217;ll learn how to use the C# AutoResetEvent class to synchronize threads and control their executions by signaling events between them. Introduction to the C# AutoResetEvent class The AutoResetEvent class allows multiple threads to communicate with each other by signaling events. An AutoResetEvent has two states: When an AutoResetEvent object is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":760,"menu_order":15,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-890","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":5,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/890\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/890\/revisions\/904"}],"up":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/760"}],"wp:attachment":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/media?parent=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}