{"id":1070,"date":"2023-04-01T09:09:39","date_gmt":"2023-04-01T02:09:39","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=1070"},"modified":"2023-06-17T22:00:26","modified_gmt":"2023-06-17T15:00:26","slug":"csharp-anonymous-type","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-anonymous-type\/","title":{"rendered":"C# Anonymous Types"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn about C# anonymous types to create a single object that consists of read-only properties without having to define a class first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to C# anonymous types<\/h2>\n\n\n\n<p>Typically, you define a <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-class\/\">class<\/a> that has a set of properties and use the class to create objects.<\/p>\n\n\n\n<p>But sometimes you need to create an object that has a set of read-only properties without having to define a class. To do it, you use anonymous types.<\/p>\n\n\n\n<p>By definition, anonymous types allow you to encapsulate a set of read-only properties into a single object without having to define a class first.<\/p>\n\n\n\n<p>Behind the scenes, the compiler will generate the type name for the anonymous type. Therefore, the type name is not accessible at the source code level. The compiler also infers the type of each property of the anonymous type.<\/p>\n\n\n\n<p>To create anonymous types, you use the <code>new<\/code> operator with an <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-object-initializer\/\">object initializer<\/a>. For example, the following demonstrates how to create an anonymous type with two properties named <code>Name<\/code> and <code>Price<\/code>:<\/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\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> product = <span class=\"hljs-keyword\">new<\/span>\n{\n    Name = <span class=\"hljs-string\">\"Phone X\"<\/span>,\n    Price = <span class=\"hljs-number\">999.99<\/span>\n};\n\nWriteLine(<span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{product.Name}<\/span> : <span class=\"hljs-subst\">{product.Price:C}<\/span>\"<\/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>Output:<\/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\">Phone X : $<span class=\"hljs-number\">999.99<\/span><\/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>If you hover the mouse over the <code>Name<\/code> or <code>Price<\/code> properties, you&#8217;ll see that the compiler infers the type of the <code>Name<\/code> property to string and the type of the <code>Price<\/code> property to <code>double<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"414\" src=\"https:\/\/csharptutorial.net\/wp-content\/uploads\/2023\/04\/c-anonymous-types.png\" alt=\"c# anonymous types\" class=\"wp-image-1324\" srcset=\"https:\/\/www.csharptutorial.net\/wp-content\/uploads\/2023\/04\/c-anonymous-types.png 610w, https:\/\/www.csharptutorial.net\/wp-content\/uploads\/2023\/04\/c-anonymous-types-300x204.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<p>Because the <code>Name<\/code> and <code>Price<\/code> properties are read-only, if you attempt to assign a new value to it, you&#8217;ll get a compiled error. For example:<\/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\">product.Price = <span class=\"hljs-number\">2000<\/span>; <span class=\"hljs-comment\">\/\/ error<\/span><\/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>To form a new anonymous object with the same name and different price, you can use the <code>with<\/code> expression.<\/p>\n\n\n\n<p>The <code>with<\/code> expression creates an anonymous type object where one or more properties have new values. For example:<\/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-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> product = <span class=\"hljs-keyword\">new<\/span>\n{\n    Name = <span class=\"hljs-string\">\"Phone X\"<\/span>,\n    Price = <span class=\"hljs-number\">999.99<\/span>\n};\nWriteLine(<span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{product.Name}<\/span> : <span class=\"hljs-subst\">{product.Price:C}<\/span>\"<\/span>);\n\n\n<span class=\"hljs-keyword\">var<\/span> productX = product with\n{\n    Price = <span class=\"hljs-number\">1099.99<\/span>\n};\nWriteLine(<span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{productX.Name}<\/span> : <span class=\"hljs-subst\">{productX.Price:C}<\/span>\"<\/span>);\n<\/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>Output:<\/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\">Phone X : $<span class=\"hljs-number\">999.99<\/span>\nPhone X : $<span class=\"hljs-number\">1<\/span>,<span class=\"hljs-number\">099.99<\/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>In this example, we use the <code>with<\/code> expression to create a new instance of the same anonymous type with the <code>product<\/code> object, but with the new <code>Price<\/code> value.<\/p>\n\n\n\n<p>It&#8217;s possible to define an <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-array\/\">array<\/a> of anonymous types like this:<\/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> products = <span class=\"hljs-keyword\">new<\/span>&#91;]\n{\n    <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">999.99<\/span> },\n    <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Computer Y\"<\/span>, Price = <span class=\"hljs-number\">1999.99<\/span> },\n    <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Tablet Z\"<\/span>, Price = <span class=\"hljs-number\">2999.99<\/span> }\n};<\/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>And an anonymous type can have properties that are instances of explicit types. For example:<\/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-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n\n<span class=\"hljs-keyword\">var<\/span> product = <span class=\"hljs-keyword\">new<\/span>\n{\n    Name = <span class=\"hljs-string\">\"Phone X\"<\/span>,\n    Price = <span class=\"hljs-number\">999.99<\/span>,\n    attribute = <span class=\"hljs-keyword\">new<\/span> ProductAttribute() { Color = <span class=\"hljs-string\">\"Black\"<\/span>, Weight = <span class=\"hljs-number\">100<\/span> }\n};\n\nWriteLine(<span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{product.Name}<\/span>: <span class=\"hljs-subst\">{product.attribute.Color}<\/span>\"<\/span>);\n\n\n\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">ProductAttribute<\/span>\n{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span>? Color\n    {\n        <span class=\"hljs-keyword\">get<\/span>; init;\n    }\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">decimal<\/span>? Weight\n    {\n        <span class=\"hljs-keyword\">get<\/span>; init;\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>In this example, we define an anonymous object with a property that is an instance of the <code>ProductAttribute<\/code> class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The supertype of anonymous types <\/h2>\n\n\n\n<p>Anonymous types inherit directly from the <code><a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-object\/\">object<\/a><\/code> type. And you cannot cast anonymous types to any type except <code>object<\/code>.<\/p>\n\n\n\n<p>If you have two or more anonymous objects that have the same set of properties in the same order and types, the compiler will treat these objects with the same type. In other words, they share the same generated type. For example:<\/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\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> productX = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">999.99<\/span> };\n<span class=\"hljs-keyword\">var<\/span> productY = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone Y\"<\/span>, Price = <span class=\"hljs-number\">555.99<\/span> };\n\nWriteLine(productX.GetType() == productY.GetType()); <span class=\"hljs-comment\">\/\/ true<\/span><\/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>Output:<\/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\">&lt;&gt;f__AnonymousType0`<span class=\"hljs-number\">2<\/span>&#91;System.String,System.Double]\nTrue<\/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>In this example, <code>productX<\/code> and <code>productY<\/code> will share the same anonymous type&#8217;s name. Note that you may get a different generated type name.<\/p>\n\n\n\n<p>Two anonymous objects of the same type are equal if all their properties are equal. For example:<\/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\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> productX = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">99<\/span> };\n<span class=\"hljs-keyword\">var<\/span> productY = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">99<\/span> };\n\nWriteLine(productX.Equals(productY));<\/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>Output:<\/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\">True<\/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>The reason is that anonymous types override the <code>Equals<\/code> and <code>GetHashCode<\/code> methods in terms of <code>Equals<\/code> and <code>GetHashCode<\/code> methods of its properties.<\/p>\n\n\n\n<p>Anonymous types override the <code>ToString<\/code> method by concatenating the results of <code>ToString<\/code> method of all properties and wrapping it in curly braces:<\/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\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> productX = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">99<\/span> };\n\nWriteLine(productX.ToString());<\/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>Output:<\/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\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">var<\/span> productX = <span class=\"hljs-keyword\">new<\/span> { Name = <span class=\"hljs-string\">\"Phone X\"<\/span>, Price = <span class=\"hljs-number\">99<\/span> };\n\nWriteLine(productX.ToString());<\/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>Output:<\/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\">{ Name = Phone X, Price = <span class=\"hljs-number\">99<\/span> }<\/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 anonymous types to create an object with read-only properties.<\/li>\n\n\n\n<li>Use the <code>new<\/code> keyword and an <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-object-initializer\/\">object initializer<\/a> to declare an anonymous type.<\/li>\n\n\n\n<li>Use anonymous types when you want to create an object that stores data temporarily without defining a separate type.<\/li>\n\n\n\n<li>Anonymous types are immutable, implicitly typed, and created at runtime.<\/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=\"1070\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-anonymous-type\/\"\n\t\t\t\tdata-post-title=\"C# Anonymous Types\"\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=\"1070\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-anonymous-type\/\"\n\t\t\t\tdata-post-title=\"C# Anonymous Types\"\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>In this tutorial, you&#8217;ll learn about C# anonymous types to create a single object that consists of read-only properties without having to define a class first.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":7,"menu_order":77,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1070","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1070","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=1070"}],"version-history":[{"count":5,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1070\/revisions"}],"predecessor-version":[{"id":2316,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1070\/revisions\/2316"}],"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=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}