{"id":743,"date":"2016-03-02T22:53:56","date_gmt":"2016-03-02T13:53:56","guid":{"rendered":"http:\/\/gomocool.net\/gomokulog\/?p=743"},"modified":"2016-03-02T22:53:56","modified_gmt":"2016-03-02T13:53:56","slug":"c%e3%81%a7%e3%81%ae%e5%88%9d%e6%9c%9f%e5%8c%96%e5%ad%90%e3%81%82%e3%82%8c%e3%81%93%e3%82%8c","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=743","title":{"rendered":"C#\u3067\u306e\u521d\u671f\u5316\u5b50\u3042\u308c\u3053\u308c"},"content":{"rendered":"<p>C#\u3067\u3001\u3088\u304f\u4f7f\u3044\u826f\u304f\u5fd8\u308c\u308b\u3001\u914d\u5217\u521d\u671f\u5316\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u521d\u671f\u5316\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u521d\u671f\u5316\u306e\u4f8b\u3092\u4e26\u3079\u3066\u307f\u308b\u3002<\/p>\n<h2>\u914d\u5217\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true\">string[] week = { \"\u65e5\u66dc\u65e5\", \"\u6708\u66dc\u65e5\", \"\u706b\u66dc\u65e5\", \"\u6c34\u66dc\u65e5\", \"\u6728\u66dc\u65e5\", \"\u91d1\u66dc\u65e5\", \"\u571f\u66dc\u65e5\" };\r\nint[] prime = { 2, 3, 5, 7, 11 };<\/pre>\n<h2>List\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true \">List&lt;string&gt; PrefectureNameList = new List&lt;string&gt; { \"Tokyo\", \"Osaka\", \"Fukuoka\" };\r\nList&lt;int&gt; PointList = new List&lt;int&gt; { 70, 98, 30 };<\/pre>\n<h2>Dictionary\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true\">Dictionary&lt;string, string&gt; PrefectureEnToJp = new Dictionary&lt;string, string&gt; { \r\n    [\"Tokyo\"] = \"\u6771\u4eac\", \r\n    [\"Osaka\"] = \"\u5927\u962a\", \r\n    [\"Fukuoka\"] = \"\u798f\u5ca1\" \r\n};\r\nDictionary&lt;string, int&gt; PrefectureCode = new Dictionary&lt;string, int&gt; {\r\n    [\"Tokyo\"] = 13,\r\n    [\"Osaka\"] = 27,\r\n    [\"Fukuoka\"] = 40\r\n };<\/pre>\n<h2>\u533f\u540d\u578b\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true \">var pet = new { Age = 10, Name = \"Pochi\" };<\/pre>\n<h2>\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true\" title=\"Student\u30af\u30e9\u30b9\">public class Student\r\n{\r\n\tpublic string FirstName { get; set; } = \"Gonbei\";\r\n\tpublic string LastName { get; set; } = \"Nanashi\";\r\n\tpublic string Class { get; set; }\r\n\r\n\tpublic List&lt;int&gt; PointList { get; set; } = new List&lt;int&gt;();\r\n}<\/pre>\n<p>\u30d7\u30ed\u30d1\u30c6\u30a3(Property)\u306e\u521d\u671f\u5316\u306f\u3001VS2015\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<h2>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8(\u30af\u30e9\u30b9)\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true\">Student myStudent = new Student()\r\n{\r\n\tFirstName = \"Taro\",\r\n\tLastName = \"Yamada\",\r\n\tClass = \"B\",\r\n\tPointList = new List&lt;int&gt; { 40, 30, 80 }\r\n};<\/pre>\n<p>\u3082\u3061\u308d\u3093\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u521d\u671f\u5316\u6642\u306b\u3001\u5185\u5305\u3059\u308bList\u3082\u521d\u671f\u5316\u53ef\u80fd\u3002<\/p>\n<h2>\u30af\u30e9\u30b9\u3092\u542b\u3081\u305f\u306eList\u578b\u306e\u521d\u671f\u5316<\/h2>\n<pre class=\"lang:c# decode:true\">List&lt;Student&gt; studentList = new List&lt;Student&gt;()\r\n{\r\n    new Student() { \r\n        FirstName = \"Taro\", \r\n        LastName = \"Yamada\", \r\n        PointList = new List&lt;int&gt; { 10, 20 } \r\n    },\r\n    new Student() { \r\n        FirstName = \"Hanako\", \r\n        LastName = \"Suzuki\", \r\n        PointList = new List&lt;int&gt; { 30, 25, 10 } },\r\n    null\r\n};<\/pre>\n<p>\u3042\u307e\u308a\u4f7f\u3044\u9053\u7121\u3044\u6c17\u3082\u3059\u308b\u3051\u3069\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092null\u3067\u521d\u671f\u5316\u3082\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C#\u3067\u3001\u3088\u304f\u4f7f\u3044\u826f\u304f\u5fd8\u308c\u308b\u3001\u914d\u5217\u521d\u671f\u5316\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u521d\u671f\u5316\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u521d\u671f\u5316\u306e\u4f8b\u3092\u4e26\u3079\u3066\u307f\u308b\u3002 \u914d\u5217\u306e\u521d\u671f\u5316 string[] week = { &#8220;\u65e5\u66dc\u65e5&#8221;, &#8220;\u6708\u66dc\u65e5&#8221;, &#8220;\u706b\u66dc\u65e5&#8221;, &#8220;\u6c34\u66dc\u65e5&#8221;, &#8220;\u6728\u66dc\u65e5&#8221;, &#8220;&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=743\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,20],"tags":[],"class_list":["post-743","post","type-post","status-publish","format-standard","hentry","category-dot-net","category-csharp"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=743"}],"version-history":[{"count":3,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/743\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/743\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}