{"id":1426,"date":"2023-04-08T10:01:46","date_gmt":"2023-04-08T03:01:46","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=1426"},"modified":"2023-04-08T10:06:58","modified_gmt":"2023-04-08T03:06:58","slug":"csharp-namespaces","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-namespaces\/","title":{"rendered":"C# Namespaces"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn about C# namespaces and how to use namespaces to organize code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the C# namespaces<\/h2>\n\n\n\n<p>C# namespaces allow you to group related <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-class\/\">classes<\/a>, <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-interface\/\">interfaces<\/a>, structs, <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-enum\/\">enums<\/a>, and <a href=\"https:\/\/csharptutorial.net\/csharp-tutorial\/csharp-delegate\/\">delegates<\/a> into a single logical unit. Namespaces also help you avoid naming conflict issues.<\/p>\n\n\n\n<p>To declare a namespace, you use the <code>namespace<\/code> keyword followed by the namespace name as follows:<\/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\">namespace<\/span> <span class=\"hljs-title\">namespaceName<\/span>\n{\n   <span class=\"hljs-comment\">\/\/ code elements<\/span>\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>For example, you can create the <code>HR.cs<\/code> file and define a new namespace called <code><code>HR<\/code><\/code>:<\/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\">namespace<\/span> <span class=\"hljs-title\">HR<\/span>\n{\n    <span class=\"hljs-comment\">\/\/ code elements<\/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>In this example, <code><code>HR<\/code><\/code> is the name of the namespace. Inside the <code><code>HR<\/code><\/code> namespace, you can define types like classes and interfaces. For instance:<\/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\">namespace<\/span> <span class=\"hljs-title\">HR<\/span>\n{\n    <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span>\n    {\n        <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> Name\n        {\n            <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n        }\n        <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> JobTitle\n        {\n            <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n        }\n\n        <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">override<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-title\">ToString<\/span>(<span class=\"hljs-params\"><\/span>)<\/span> =&gt; <span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{Name}<\/span> (<span class=\"hljs-subst\">{JobTitle}<\/span>)\"<\/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<p>All the types that you define inside the curly braces of the <code><code>HR<\/code><\/code> namespace will belong to the <code><code>HR<\/code><\/code> namespace.<\/p>\n\n\n\n<p>Starting from C# 10, you can simplify the namespace syntax by removing the opening and closing curly braces like this:<\/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\">namespace<\/span> <span class=\"hljs-title\">HR<\/span>;\n\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span>\n{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> Name\n    {\n        <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n    }\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> JobTitle\n    {\n        <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n    }\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">override<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-title\">ToString<\/span>(<span class=\"hljs-params\"><\/span>)<\/span> =&gt; <span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{Name}<\/span> (<span class=\"hljs-subst\">{JobTitle}<\/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>By doing this, all the types that you define in the <code>HR.cs<\/code> file will belong to the <code><code>HR<\/code><\/code> namespace. <\/p>\n\n\n\n<p>This new syntax looks cleaner and saves horizontal space. It also makes your code easier to read. <\/p>\n\n\n\n<p>To use the <code>Employee<\/code> class inside the <code>Program.cs<\/code> file, you can reference the fully qualified name of the class like this:<\/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\">var<\/span> employee = <span class=\"hljs-keyword\">new<\/span> HR.Employee()\n{\n    Name = <span class=\"hljs-string\">\"John Doe\"<\/span>,\n    JobTitle = <span class=\"hljs-string\">\"C# Developer\"<\/span>\n};\n\nConsole.WriteLine(employee);<\/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>Typically, you use the <code>using<\/code> statement to reference a class in a namespace without specifying the fully qualified namespace of that class. For example:<\/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\">using<\/span> HR;\n\n<span class=\"hljs-keyword\">var<\/span> employee = <span class=\"hljs-keyword\">new<\/span> Employee()\n{\n    Name = <span class=\"hljs-string\">\"John Doe\"<\/span>,\n    JobTitle = <span class=\"hljs-string\">\"C# Developer\"<\/span>\n};\n\nConsole.WriteLine(employee);<\/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>In this example, we use the using statement to explicitly import the <code>HR<\/code> namespace and reference the <code>Employee<\/code> class using just the class name only.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Nested namespaces<\/h2>\n\n\n\n<p>Nested namespaces are namespaces that you define in another namespace. They allow you to organize the code elements more granularly especially when you work with larger codebases.<\/p>\n\n\n\n<p>To define nested namespaces in C#, you simply declare them inside another namespace. 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\">namespace<\/span> <span class=\"hljs-title\">HR<\/span>\n{\n    <span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">Personnel<\/span>\n    {\n        <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span>\n        {\n            <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> Name\n            {\n                <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n            }\n            <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> JobTitle\n            {\n                <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n            }\n\n            <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">override<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-title\">ToString<\/span>(<span class=\"hljs-params\"><\/span>)<\/span> =&gt; <span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{Name}<\/span> (<span class=\"hljs-subst\">{JobTitle}<\/span>)\"<\/span>;\n        }\n    }\n    <span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">Payroll<\/span>\n    {\n        <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">SalaryCalculator<\/span>\n        {\n        }\n    \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 two nested namespaces <code>Personnel<\/code> and <code>Payroll<\/code> inside the <code>HR<\/code> namespace. The <code>Personnel<\/code> namespace has the <code>Employee<\/code> class and the <code>Payroll<\/code> namespace has the <code>SalaryCalculator<\/code> class.<\/p>\n\n\n\n<p>To reference a nested namespace, you use dot notation to indicate the parent-child relationship between the namespaces. 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> HR.Personnel;\n<span class=\"hljs-keyword\">using<\/span> HR.Payroll;<\/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, we use the <code>using<\/code> statement to import the <code>Personnel<\/code> and <code>Payroll<\/code> namespaces from the <code>HR<\/code> namespace.<\/p>\n\n\n\n<p>And you can reference the types in these nested namespaces without the fully qualified names:<\/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-keyword\">using<\/span> HR.Personnel;\n<span class=\"hljs-keyword\">using<\/span> HR.Payroll;\n\n<span class=\"hljs-keyword\">var<\/span> employee = <span class=\"hljs-keyword\">new<\/span> Employee()\n{\n    Name = <span class=\"hljs-string\">\"John Doe\"<\/span>,\n    JobTitle = <span class=\"hljs-string\">\"C# Developer\"<\/span>\n};\n\nConsole.WriteLine(employee);\n\n<span class=\"hljs-keyword\">var<\/span> salaryCalculator = <span class=\"hljs-keyword\">new<\/span> SalaryCalculator();<\/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>When you use nested namespaces, it&#8217;s important to keep the nesting level at a reasonable level. If you nest too deeply, your code will be harder to understand and maintain.  It&#8217;s a common practice to aim for a nesting level of no more than 3 or 4 levels deep.<\/p>\n\n\n\n<p>Notice that when you import a namespace, it doesn&#8217;t automatically import the nested namespace. 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> HR;\n\n<span class=\"hljs-keyword\">var<\/span> employee = <span class=\"hljs-keyword\">new<\/span> Employee() <span class=\"hljs-comment\">\/\/ ERROR<\/span>\n{\n    Name = <span class=\"hljs-string\">\"John Doe\"<\/span>,\n    JobTitle = <span class=\"hljs-string\">\"C# Developer\"<\/span>\n};\n\nConsole.WriteLine(employee);<\/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>In this example, the using <code><code>HR<\/code><\/code> statement only imports the types in the <code><code>HR<\/code><\/code> namespace but types in the nested namespace. Therefore, it results in an error.<\/p>\n\n\n\n<p>To fix it, you need to import the <code>HR<\/code>.Personnel namespace or reference the <code>Employee<\/code> class using a fully qualified name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using C# namespace to avoid naming conflict<\/h2>\n\n\n\n<p>Namespaces can help you avoid naming conflicts. For example, you may have the same class name in different namespaces.<\/p>\n\n\n\n<p>This is because namespaces act as a container for code elements and when you prefix the code elements with namespaces, the code elements will be uniquely identifiable.<\/p>\n\n\n\n<p>For example:<\/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-keyword\">namespace<\/span> <span class=\"hljs-title\">HR<\/span>\n{\n    <span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">Dependents<\/span>\n    {\n        <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Person<\/span>\n        {\n            <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> Name\n            {\n                <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n            }\n        }\n    }\n\n    <span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">Personnel<\/span>\n    {\n        <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Person<\/span>\n        {\n            <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> Name\n            {\n                <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n            }\n        }\n        <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span> : <span class=\"hljs-title\">Person<\/span>\n        {\n\n            <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">string<\/span> JobTitle\n            {\n                <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>;\n            }\n            <span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">override<\/span> <span class=\"hljs-keyword\">string<\/span> <span class=\"hljs-title\">ToString<\/span>(<span class=\"hljs-params\"><\/span>)<\/span> =&gt; <span class=\"hljs-string\">$\"<span class=\"hljs-subst\">{Name}<\/span> (<span class=\"hljs-subst\">{JobTitle}<\/span>)\"<\/span>;\n        }\n    }\n\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<p>In this example, we have the same Person class in different namespaces <code>Dependents<\/code> and <code>Personnel<\/code>. If you import both <code>HR.Personnel<\/code> and <code>HR.Dependents<\/code> namespaces into the same file, you&#8217;ll get an error:<\/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> HR.Personnel;\n<span class=\"hljs-keyword\">using<\/span> HR.Dependents;\n\n<span class=\"hljs-keyword\">var<\/span> child = <span class=\"hljs-keyword\">new<\/span> Person(); <span class=\"hljs-comment\">\/\/ ERROR<\/span><\/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>The reason is that when you reference the <code>Person<\/code> class, the compiler doesn&#8217;t know the exact namespace of the <code>Person<\/code> class.<\/p>\n\n\n\n<p>To fix this, you need to use a fully qualified class name and only import the namespace that you use often in the code. For example:<\/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> HR.Dependents;\n\n<span class=\"hljs-comment\">\/\/ comes from HR.Dependents<\/span>\n<span class=\"hljs-keyword\">var<\/span> child = <span class=\"hljs-keyword\">new<\/span> Person();\n\n<span class=\"hljs-comment\">\/\/ comes from HR.Personnel<\/span>\n<span class=\"hljs-keyword\">var<\/span> father = <span class=\"hljs-keyword\">new<\/span> HR.Personnel.Employee(); <\/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>In this example, the <code>Person<\/code> class refers to the Person class in the <code>HR.Dependents<\/code> namespace. To reference the <code>Employee<\/code> class in the <code>HR.Personnel<\/code> namespace, you need to use the fully qualified class name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C# namespace best practices<\/h2>\n\n\n\n<p>The following are the best practices when it comes to using namespaces in C#:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use meaningful and descriptive namespace names.<\/li>\n\n\n\n<li>Use nested namespaces to further organize code elements but avoid using nested namespaces that are too deep or complex.<\/li>\n\n\n\n<li>Use using directives sparingly and only for frequently used namespaces.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use namespace and nested namespace to make your code more organized, especially when working with a large codebase.<\/li>\n\n\n\n<li>Use namespaces to avoid naming conflicts.<\/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=\"1426\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-namespaces\/\"\n\t\t\t\tdata-post-title=\"C# Namespaces\"\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=\"1426\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-namespaces\/\"\n\t\t\t\tdata-post-title=\"C# Namespaces\"\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# namespaces and how to use namespaces to organize code.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":7,"menu_order":55,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1426","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1426","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=1426"}],"version-history":[{"count":4,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1426\/revisions"}],"predecessor-version":[{"id":1432,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1426\/revisions\/1432"}],"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=1426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}