{"id":331,"date":"2022-01-04T22:53:53","date_gmt":"2022-01-04T15:53:53","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=331"},"modified":"2022-06-03T13:40:21","modified_gmt":"2022-06-03T06:40:21","slug":"c-indexer","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-tutorial\/c-indexer\/","title":{"rendered":"C# Indexer"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the C# indexer to make an object indexed like an array.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the C# indexer<\/h2>\n\n\n\n<p>An index allows an object of a <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-class\/\">class<\/a> to be indexed like an <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-array\/\">array<\/a>. To define an indexer for a class, you use the following syntax:<\/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\">class<\/span> <span class=\"hljs-title\">MyClass<\/span>\n{\n    <span class=\"hljs-keyword\">public<\/span> type <span class=\"hljs-keyword\">this<\/span>&#91;<span class=\"hljs-keyword\">int<\/span> index]\n    {\n        <span class=\"hljs-keyword\">get<\/span> { <span class=\"hljs-comment\">\/\/ return a value }<\/span>\n        <span class=\"hljs-keyword\">set<\/span> { <span class=\"hljs-comment\">\/\/ assing a value }<\/span>\n    }\n}<\/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 syntax of an indexer is like a <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-property\/\">property<\/a> except that its accessor takes a parameter:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, define the <code>type<\/code> of the return value.<\/li><li>Second, define the indexer using the use <code><a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-this\/\">this<\/a><\/code> keyword.<\/li><li>Third, define a parameter of the indexer. The parameter doesn&#8217;t have to be an integer. The parameter&#8217;s type depends on how you design the look-up mechanism. Also, an indexer can have more than one parameter.<\/li><li>Finally, define the <code>get<\/code> and <code>set<\/code> accessors. The <code>get<\/code> accessor returns a value while the <code>set<\/code> accessor assigns a value. If the indexer doesn&#8217;t have the <code>set<\/code> accessor, it&#8217;s a readonly indexer.<\/li><\/ul>\n\n\n\n<p>Note that indexers can be overloaded. In other words, a class can have multiple indexers.<\/p>\n\n\n\n<p>If you omit the <code>set<\/code> accessor, the indexer becomes read-only. In this case, you can use expression-bodied syntax to shorten its definition:<\/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\">class<\/span> <span class=\"hljs-title\">MyClass<\/span>\n{\n    <span class=\"hljs-keyword\">public<\/span> type <span class=\"hljs-keyword\">this<\/span>&#91;<span class=\"hljs-keyword\">int<\/span> index] =&gt; returnValue;\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>Note that you don&#8217;t need to use the <code>get<\/code> keyword.<\/p>\n\n\n\n<p>Starting with C# 7, you can use expression-bodied syntax for both <code>get<\/code> and <code>set<\/code> accessors. However, you need to use the <code>get<\/code> and <code>set<\/code> keywords in this case:<\/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\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyClass<\/span>\n{\n    <span class=\"hljs-keyword\">public<\/span> type <span class=\"hljs-keyword\">this<\/span>&#91;<span class=\"hljs-keyword\">int<\/span> i]\n    {\n        <span class=\"hljs-keyword\">get<\/span> =&gt; member&#91;i];\n        <span class=\"hljs-keyword\">set<\/span> =&gt; member&#91;i] = <span class=\"hljs-keyword\">value<\/span>;\n    }\n}<\/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<h2 class=\"wp-block-heading\">C# indexer examples<\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using indexers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) C# readonly indexer example<\/h3>\n\n\n\n<p>Suppose you have a sentence like the following:<\/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\"><span class=\"hljs-string\">\"C# is awesome\"<\/span><\/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>And you want to access each word of the sentence using an index. For example:<\/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\">sentence&#91;<span class=\"hljs-number\">0<\/span>]<\/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>It should return the first word (<code>C#<\/code>), not the first character (<code>C<\/code>):<\/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-string\">\"C#\"<\/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>To do that, you can define a new class and use an indexer.<\/p>\n\n\n\n<p>First, create a new file called <code>Sentence.cs<\/code>.<\/p>\n\n\n\n<p>Second, define the <code>Sentence<\/code> class in the <code>Sentence.cs<\/code> file:<\/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-comment\">\/\/ Sentence.cs<\/span>\n\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Sentence<\/span>\n{\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">string<\/span>&#91;] words;\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-title\">Sentence<\/span>(<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> s<\/span>)<\/span>\n    {\n        words = s.Split(<span class=\"hljs-string\">' '<\/span>);\n    }\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>Sentence()<\/code> constructor splits an input string by the space into words and assigns the result to the <code>words<\/code> field.<\/p>\n\n\n\n<p>Third, define an indexer in the <code>Sentence<\/code> class:<\/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-comment\">\/\/ Sentence.cs<\/span>\n\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Sentence<\/span>\n{\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">string<\/span>&#91;] words;\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-title\">Sentence<\/span>(<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> s<\/span>)<\/span>\n    {\n        words = s.Split(<span class=\"hljs-string\">' '<\/span>);\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-keyword\">this<\/span>&#91;<span class=\"hljs-keyword\">int<\/span> index]\n    {\n        <span class=\"hljs-keyword\">get<\/span>\n        {\n            <span class=\"hljs-keyword\">return<\/span> words&#91;index];\n        }\n    }\n}<\/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>In this example, the indexer returns the word in the sentence based on an index.<\/p>\n\n\n\n<p>The following illustrates how to use the indexer of the sentence&#8217;s object:<\/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\"><span class=\"hljs-comment\">\/\/ Program.cs<\/span>\n<span class=\"hljs-keyword\">var<\/span> sentence = <span class=\"hljs-keyword\">new<\/span> Sentence(<span class=\"hljs-string\">\"C# is awesome\"<\/span>);\n\nConsole.WriteLine(sentence&#91;<span class=\"hljs-number\">0<\/span>]);\nConsole.WriteLine(sentence&#91;<span class=\"hljs-number\">1<\/span>]);\nConsole.WriteLine(sentence&#91;<span class=\"hljs-number\">2<\/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>Output:<\/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\">C<span class=\"hljs-meta\">#<\/span>\n<span class=\"hljs-keyword\">is<\/span>\nawesome<\/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>Because the indexer in the <code>Sentence<\/code> class is read-only, you can shorten it using the expression-bodied syntax like this:<\/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\"><span class=\"hljs-comment\">\/\/ Sentence.cs<\/span>\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Sentence<\/span>\n{\n    <span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">string<\/span>&#91;] words;\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-title\">Sentence<\/span>(<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> s<\/span>)<\/span>\n    {\n        words = s.Split(<span class=\"hljs-string\">' '<\/span>);\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-keyword\">this<\/span>&#91;<span class=\"hljs-keyword\">int<\/span> index] =&gt; words&#91;index];\n}<\/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<h3 class=\"wp-block-heading\">2) C# indexer example with set and get accessors<\/h3>\n\n\n\n<p>The following example defines the class <code>Matrix<\/code> that uses a <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-multidimensional-array\/\">multidimensional array<\/a> as a field and an indexer to access its elements:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Matrix.cs<\/span>\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Matrix<\/span>\n<\/span>{\n    private double&#91;,] data;\n    public Matrix(int row, int column)\n    {\n        data = <span class=\"hljs-keyword\">new<\/span> double&#91;row, column];\n    }\n\n    public double <span class=\"hljs-keyword\">this<\/span>&#91;int row, int column]\n    {\n        <span class=\"hljs-keyword\">get<\/span> { <span class=\"hljs-keyword\">return<\/span> data&#91;row, column]; }\n        <span class=\"hljs-keyword\">set<\/span> { data&#91;row, column] = value; }\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, you can use the Matrix&#8217;s object like an array like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Program.cs<\/span>\n<span class=\"hljs-keyword\">var<\/span> matrix = <span class=\"hljs-keyword\">new<\/span> Matrix(<span class=\"hljs-number\">3<\/span>,<span class=\"hljs-number\">3<\/span>);\n\n<span class=\"hljs-keyword\">for<\/span> (int row = <span class=\"hljs-number\">0<\/span>; row &lt; <span class=\"hljs-number\">3<\/span>; row++)\n{\n    <span class=\"hljs-keyword\">for<\/span> (int column = <span class=\"hljs-number\">0<\/span>; column &lt; <span class=\"hljs-number\">3<\/span>; column++)\n    {\n        matrix&#91;row, column] = row + column;\n    }\n}\n\n\n<span class=\"hljs-keyword\">for<\/span> (int row = <span class=\"hljs-number\">0<\/span>; row &lt; <span class=\"hljs-number\">3<\/span>; row++)\n{\n    <span class=\"hljs-keyword\">for<\/span> (int column = <span class=\"hljs-number\">0<\/span>; column &lt; <span class=\"hljs-number\">3<\/span>; column++)\n    {\n        Console.Write($<span class=\"hljs-string\">\"{matrix&#91;row, column]} \"<\/span>);\n    }\n    Console.WriteLine();\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">0 1 2\n1 2 3\n2 3 4<\/code><\/span><\/pre>\n\n\n<p>Note that you can use the <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-expression-bodied-members\/\">expression-bodied syntax<\/a> for the <code>get<\/code> and <code>set<\/code> accessors of the indexer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use  C# indexer to enable an object to be indexed like an array.<\/li><\/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=\"331\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/c-indexer\/\"\n\t\t\t\tdata-post-title=\"C# Indexer\"\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=\"331\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/c-indexer\/\"\n\t\t\t\tdata-post-title=\"C# Indexer\"\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# indexer to make an object indexed like an array. Introduction to the C# indexer An index allows an object of a class to be indexed like an array. To define an indexer for a class, you use the following syntax: The syntax of an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":7,"menu_order":36,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-331","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/331","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=331"}],"version-history":[{"count":5,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/331\/revisions"}],"predecessor-version":[{"id":709,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/331\/revisions\/709"}],"up":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/7"}],"wp:attachment":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/media?parent=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}