{"id":1974,"date":"2024-12-25T16:44:35","date_gmt":"2024-12-25T07:44:35","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=1974"},"modified":"2025-03-24T08:48:59","modified_gmt":"2025-03-23T23:48:59","slug":"c-if%e6%96%87%e5%ae%8c%e5%85%a8%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%ef%bc%9a%e7%9f%a5%e3%81%a3%e3%81%a6%e3%81%8a%e3%81%8f%e3%81%b9%e3%81%8d15%e3%81%ae%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=1974","title":{"rendered":"C# if\u6587\u5b8c\u5168\u30de\u30b9\u30bf\u30fc\uff1a\u77e5\u3063\u3066\u304a\u304f\u3079\u304d15\u306e\u30c6\u30af\u30cb\u30c3\u30af\u30685\u3064\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">\u306f\u3058\u3081\u306b<\/a>  <\/li>  <li>    <a href=\"#i-1\">C# if\u6587\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-2\">if\u6587\u306e\u57fa\u672c\u7684\u306a\u66f8\u304d\u65b9\u3068\u52d5\u4f5c\u539f\u7406<\/a>      <\/li>      <li>        <a href=\"#i-5\">else\u6587\u3068else if\u6587\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90\u306e\u62e1\u5f35<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-6\">\u6761\u4ef6\u5f0f\u3067\u4f7f\u7528\u3067\u304d\u308b\u6f14\u7b97\u5b50\u3068\u6bd4\u8f03\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-13\">if\u6587\u306e\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-14\">\u8907\u6570\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u9ad8\u5ea6\u306a\u6761\u4ef6\u5206\u5c90<\/a>      <\/li>      <li>        <a href=\"#i-17\">\u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u7c21\u7565\u5316<\/a>      <\/li>      <li>        <a href=\"#i-18\">null\u30c1\u30a7\u30c3\u30af\u3068null\u6761\u4ef6\u6f14\u7b97\u5b50\u306e\u6d3b\u7528<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-22\">\u5b9f\u8df5\u7684\u306aTips<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-26\">if\u6587\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-27\">\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u308b\u30cd\u30b9\u30c8\u306e\u524a\u6e1b<\/a>      <\/li>      <li>        <a href=\"#i-30\">\u30ac\u30fc\u30c9\u7bc0\u306b\u3088\u308b\u53ef\u8aad\u6027\u306e\u5411\u4e0a<\/a>      <\/li>      <li>        <a href=\"#i-31\">\u6761\u4ef6\u5f0f\u306e\u6700\u9069\u306a\u8a18\u8ff0\u65b9\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-35\">\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-39\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305fif\u6587\u306e\u5b9f\u88c5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-40\">\u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u9806\u5e8f\u306e\u6700\u9069\u5316<\/a>      <\/li>      <li>        <a href=\"#i-43\">\u5206\u5c90\u4e88\u6e2c\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5f0f\u306e\u914d\u7f6e<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-46\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-49\">if\u6587\u306e\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-50\">switch\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3068switch\u5f0f\u306e\u6d3b\u7528<\/a>      <\/li>      <li>        <a href=\"#i-53\">\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-56\">\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u6d3b\u7528\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u7f6e\u304d\u63db\u3048<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-60\">\u5b9f\u8df5\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3068\u89e3\u8aac<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-61\">\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306b\u304a\u3051\u308b\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u4f8b<\/a>      <\/li>      <li>        <a href=\"#i-63\">\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3067\u306eif\u6587\u306e\u4f7f\u7528\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-65\">\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u8a2d\u8a08<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-67\">if\u6587\u306e\u307e\u3068\u3081<\/a>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>C#\u306eif\u6587\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6d41\u308c\u3092\u5236\u5fa1\u3059\u308b\u6700\u3082\u57fa\u672c\u7684\u304b\u3064\u91cd\u8981\u306a\u69cb\u6587\u3067\u3059\u3002\u5358\u7d14\u306a\u6761\u4ef6\u5206\u5c90\u304b\u3089\u8907\u96d1\u306a\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u307e\u3067\u3001\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3088\u308a\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<br>\u672c\u8a18\u4e8b\u3067\u306f\u3001if\u6587\u306e\u57fa\u790e\u304b\u3089\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067\u3001\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3092\u4ea4\u3048\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u672c\u8a18\u4e8b\u3067\u5b66\u3079\u308b\u3053\u3068<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<p class=\"is-style-sango-paragraph-idea-alt\">if\u6587\u306e\u57fa\u672c\u7684\u306a\u69cb\u6587\u3068\u6b63\u3057\u3044\u4f7f\u3044\u65b9<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea-alt\">\u8907\u6570\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u52b9\u7387\u7684\u306a\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u65b9\u6cd5<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea-alt\">\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea-alt\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305fif\u6587\u306e\u6700\u9069\u306a\u5b9f\u88c5\u624b\u6cd5<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea-alt\">switch\u5f0f\u3084\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306a\u3069\u306e\u6700\u65b0\u306e\u4ee3\u66ff\u624b\u6cd5<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea-alt\">\u5b9f\u52d9\u3067\u4f7f\u3048\u308b\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3068\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-1\">C# if\u6587\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">if\u6587\u306e\u57fa\u672c\u7684\u306a\u66f8\u304d\u65b9\u3068\u52d5\u4f5c\u539f\u7406<\/h3>\n\n\n\n<p>if\u6587\u306f\u3001C#\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308b\u6700\u3082\u57fa\u672c\u7684\u306a\u5236\u5fa1\u69cb\u6587\u306e1\u3064\u3067\u3059\u3002\u7279\u5b9a\u306e\u6761\u4ef6\u304c\u771f\uff08true\uff09\u306e\u5834\u5408\u306b\u306e\u307f\u3001\u6307\u5b9a\u3055\u308c\u305f\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u3092\u5b9f\u884c\u3059\u308b\u4ed5\u7d44\u307f\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-3\">\u57fa\u672c\u7684\u306a\u69cb\u6587<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306aif\u6587\u306e\u69cb\u6587\nif (\u6761\u4ef6\u5f0f)\n{\n    \/\/ \u6761\u4ef6\u304c\u771f\u306e\u5834\u5408\u306b\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-4\">\u5177\u4f53\u7684\u306a\u4f8b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int age = 20;\n\n\/\/ \u5e74\u9f62\u304c18\u6b73\u4ee5\u4e0a\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\nif (age &gt;= 18)\n{\n    Console.WriteLine(\"\u6210\u4eba\u3067\u3059\");  \/\/ \u6761\u4ef6\u304c\u771f\u306a\u306e\u3067\u5b9f\u884c\u3055\u308c\u308b\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">else\u6587\u3068else if\u6587\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90\u306e\u62e1\u5f35<\/h3>\n\n\n\n<p>\u8907\u6570\u306e\u6761\u4ef6\u5206\u5c90\u3092\u6271\u3046\u5834\u5408\u3001else\u6587\u3068else if\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int score = 85;\n\nif (score &gt;= 90)\n{\n    Console.WriteLine(\"\u8a55\u4fa1\uff1aA\");\n}\nelse if (score &gt;= 80)\n{\n    Console.WriteLine(\"\u8a55\u4fa1\uff1aB\");  \/\/ \u3053\u306e\u884c\u304c\u5b9f\u884c\u3055\u308c\u308b\n}\nelse if (score &gt;= 70)\n{\n    Console.WriteLine(\"\u8a55\u4fa1\uff1aC\");\n}\nelse\n{\n    Console.WriteLine(\"\u8a55\u4fa1\uff1aD\");\n}<\/pre>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u30dd\u30a4\u30f3\u30c8<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>else if\u6587\u306f\u5fc5\u8981\u306a\u6570\u3060\u3051\u8ffd\u52a0\u3067\u304d\u307e\u3059<\/li>\n\n\n\n<li>else\u6587\u306f\u6700\u5f8c\u306b1\u3064\u3060\u3051\u914d\u7f6e\u3067\u304d\u307e\u3059<\/li>\n\n\n\n<li>\u6761\u4ef6\u306f\u4e0a\u304b\u3089\u9806\u306b\u8a55\u4fa1\u3055\u308c\u3001\u6700\u521d\u306b\u771f\u3068\u306a\u3063\u305f\u6761\u4ef6\u306e\u30d6\u30ed\u30c3\u30af\u306e\u307f\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">\u6761\u4ef6\u5f0f\u3067\u4f7f\u7528\u3067\u304d\u308b\u6f14\u7b97\u5b50\u3068\u6bd4\u8f03\u65b9\u6cd5<\/h3>\n\n\n\n<p>C#\u306eif\u6587\u3067\u4f7f\u7528\u3067\u304d\u308b\u4e3b\u306a\u6f14\u7b97\u5b50\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-7\">1. \u6bd4\u8f03\u6f14\u7b97\u5b50<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7b49\u5024\u6bd4\u8f03\nif (x == y)    \/\/ \u7b49\u3057\u3044\nif (x != y)    \/\/ \u7b49\u3057\u304f\u306a\u3044\nif (x &lt; y)     \/\/ \u3088\u308a\u5c0f\u3055\u3044\nif (x &lt;= y)    \/\/ \u4ee5\u4e0b\nif (x &gt; y)     \/\/ \u3088\u308a\u5927\u304d\u3044\nif (x &gt;= y)    \/\/ \u4ee5\u4e0a<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-8\">2. \u8ad6\u7406\u6f14\u7b97\u5b50<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ AND\u6f14\u7b97\u5b50\nif (age &gt;= 18 &amp;&amp; hasLicense)    \/\/ \u4e21\u65b9\u306e\u6761\u4ef6\u304c\u771f\n\/\/ OR\u6f14\u7b97\u5b50\nif (isStudent || isSenior)      \/\/ \u3069\u3061\u3089\u304b\u306e\u6761\u4ef6\u304c\u771f\n\/\/ NOT\u6f14\u7b97\u5b50\nif (!isExpired)                 \/\/ \u6761\u4ef6\u306e\u5426\u5b9a<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-9\">3. \u578b\u30c1\u30a7\u30c3\u30af\u3068\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">object obj = \"Hello\";\n\n\/\/ \u578b\u30c1\u30a7\u30c3\u30af\nif (obj is string)\n{\n    string str = (string)obj;\n    Console.WriteLine(str.Length);\n}\n\n\/\/ \u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u4f7f\u7528\u3057\u305f\u578b\u30c1\u30a7\u30c3\u30af\u3068\u5909\u6570\u5ba3\u8a00\nif (obj is string message)\n{\n    Console.WriteLine(message.Length);  \/\/ \u30ad\u30e3\u30b9\u30c8\u4e0d\u8981\n}<\/pre>\n\n\n\n<p>\u5b9f\u8df5\u7684\u306aTips\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-10\">1. \u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u9806\u5e8f\u306b\u6ce8\u610f\u3059\u308b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u77ed\u7d61\u8a55\u4fa1\u306e\u6d3b\u7528\nif (obj != null &amp;&amp; obj.Value &gt; 0)  \/\/ null\u30c1\u30a7\u30c3\u30af\u3092\u5148\u306b\u884c\u3046<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-11\">2. \u8907\u96d1\u306a\u6761\u4ef6\u306f\u308f\u304b\u308a\u3084\u3059\u304f\u5206\u5272\u3059\u308b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u96d1\u306a\u6761\u4ef6\u306e\u5206\u5272\nbool isValidAge = age &gt;= 18 &amp;&amp; age &lt;= 65;\nbool hasRequiredDocuments = hasLicense &amp;&amp; hasInsurance;\n\nif (isValidAge &amp;&amp; hasRequiredDocuments)\n{\n    \/\/ \u51e6\u7406\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-12\">3. \u6bd4\u8f03\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5b9a\u6570\u3068\u306e\u6bd4\u8f03\u306f\u5de6\u8fba\u306b\u5b9a\u6570\u3092\u7f6e\u304f\nconst int MINIMUM_AGE = 18;\nif (MINIMUM_AGE &lt;= age)  \/\/ \u6570\u5f0f\u306e\u3088\u3046\u306a\u81ea\u7136\u306a\u8aad\u307f\u65b9<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u57fa\u672c\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u52b9\u679c\u7684\u306aif\u6587\u306e\u6d3b\u7528\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u57fa\u790e\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u305f\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-13\">if\u6587\u306e\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-14\">\u8907\u6570\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u9ad8\u5ea6\u306a\u6761\u4ef6\u5206\u5c90<\/h3>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u8907\u6570\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u8907\u96d1\u306a\u5224\u65ad\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u52b9\u679c\u7684\u306a\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-15\">1. \u8907\u6570\u6761\u4ef6\u306e\u8ad6\u7406\u7684\u306a\u30b0\u30eb\u30fc\u30d7\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30e6\u30fc\u30b6\u30fc\u306e\u6a29\u9650\u30c1\u30a7\u30c3\u30af\u306e\u4f8b\nif ((isAdmin || isModerator) &amp;&amp; !isBlocked)\n{\n    \/\/ \u7ba1\u7406\u8005\u307e\u305f\u306f\u30e2\u30c7\u30ec\u30fc\u30bf\u30fc\u3067\u3001\u304b\u3064\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\n    ManageContent();\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-16\">2. \u8907\u96d1\u306a\u6761\u4ef6\u306e\u30e1\u30bd\u30c3\u30c9\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class UserValidator\n{\n    private bool IsValidSubscription(User user)\n    {\n        return user.HasActiveSubscription \n            &amp;&amp; !user.IsTrialExpired \n            &amp;&amp; user.PaymentStatus == PaymentStatus.Valid;\n    }\n\n    private bool HasRequiredPermissions(User user, string operation)\n    {\n        return user.Permissions.Contains(operation) \n            &amp;&amp; user.IsEmailVerified \n            &amp;&amp; !user.IsRestricted;\n    }\n\n    public bool CanPerformOperation(User user, string operation)\n    {\n        if (IsValidSubscription(user) &amp;&amp; HasRequiredPermissions(user, operation))\n        {\n            return true;\n        }\n        return false;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">\u4e09\u9805\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u7c21\u7565\u5316<\/h3>\n\n\n\n<p>\u4e09\u9805\u6f14\u7b97\u5b50\uff08?:\uff09\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u6761\u4ef6\u5206\u5c90\u30921\u884c\u3067\u8a18\u8ff0\u3067\u304d\u308b\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\nstring status = age &gt;= 18 ? \"\u6210\u4eba\" : \"\u672a\u6210\u5e74\";\n\n\/\/ \u8907\u6570\u306e\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b\nstring grade = score &gt;= 90 ? \"A\" \n             : score &gt;= 80 ? \"B\"\n             : score &gt;= 70 ? \"C\"\n             : \"D\";\n\n\/\/ \u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u3067\u306e\u6d3b\u7528\nstring result = GetUser()\n    ?.Profile\n    ?.Settings\n    ?.Theme\n    ?? \"default-theme\";<\/pre>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--sgb-accent-color);color:#FFF\" class=\"sgb-box-simple__title\">\u6ce8\u610f\u70b9<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--sgb-accent-color);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>\u904e\u5ea6\u306b\u8907\u96d1\u306a\u6761\u4ef6\u306f\u907f\u3051\u3001\u53ef\u8aad\u6027\u3092\u91cd\u8996\u3059\u308b<\/li>\n\n\n\n<li>\u30cd\u30b9\u30c8\u3057\u305f\u4e09\u9805\u6f14\u7b97\u5b50\u306f\u614e\u91cd\u306b\u4f7f\u7528\u3059\u308b<\/li>\n\n\n\n<li>\u526f\u4f5c\u7528\u306e\u3042\u308b\u51e6\u7406\u306b\u306f\u4f7f\u7528\u3057\u306a\u3044<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-18\">null\u30c1\u30a7\u30c3\u30af\u3068null\u6761\u4ef6\u6f14\u7b97\u5b50\u306e\u6d3b\u7528<\/h3>\n\n\n\n<p>C#\u3067\u306f\u3001null\u30c1\u30a7\u30c3\u30af\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u69d8\u3005\u306a\u6f14\u7b97\u5b50\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-19\">1. null\u6761\u4ef6\u6f14\u7b97\u5b50\uff08?.\uff09\u306e\u4f7f\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5f93\u6765\u306enull\u30c1\u30a7\u30c3\u30af\nif (user != null &amp;&amp; user.Address != null &amp;&amp; user.Address.City != null)\n{\n    Console.WriteLine(user.Address.City);\n}\n\n\/\/ null\u6761\u4ef6\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\nConsole.WriteLine(user?.Address?.City); \/\/ null\u306e\u5834\u5408\u306fnull\u3092\u8fd4\u3059<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-20\">2. null\u5408\u4f53\u6f14\u7b97\u5b50\uff08??\uff09\u306e\u6d3b\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u8a2d\u5b9a\nstring userName = user?.Name ?? \"\u533f\u540d\u30e6\u30fc\u30b6\u30fc\";\n\n\/\/ null\u5408\u4f53\u4ee3\u5165\u6f14\u7b97\u5b50\uff08??=\uff09\npublic class UserPreferences\n{\n    private List&lt;string&gt; _favorites;\n\n    public List&lt;string&gt; Favorites\n    {\n        get =&gt; _favorites ??= new List&lt;string&gt;(); \/\/ null\u306e\u5834\u5408\u306b\u521d\u671f\u5316\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-21\">3. \u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public string GetUserInfo(User? user)\n{\n    if (user is { Name: var name, Age: &gt;= 18 })\n    {\n        return $\"{name}\u3055\u3093\uff08\u6210\u4eba\uff09\";\n    }\n    else if (user is { Name: var name })\n    {\n        return $\"{name}\u3055\u3093\uff08\u672a\u6210\u5e74\uff09\";\n    }\n    return \"\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306a\u3057\";\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-22\">\u5b9f\u8df5\u7684\u306aTips<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-23\">1. \u30c1\u30a7\u30fc\u30f3\u3055\u308c\u305fnull\u30c1\u30a7\u30c3\u30af\u306e\u7c21\u7565\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u6570\u306enull\u30c1\u30a7\u30c3\u30af\u30921\u884c\u3067\nvar cityName = order?.Customer?.Address?.City ?? \"\u4e0d\u660e\";\n\n\/\/ \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5834\u5408\nvar firstItem = collection?.FirstOrDefault()?.Name ?? \"\u30c7\u30d5\u30a9\u30eb\u30c8\";<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-24\">2. \u6761\u4ef6\u4ed8\u304d\u306e\u51e6\u7406\u5b9f\u884c<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ null\u3067\u306a\u3044\u5834\u5408\u306e\u307f\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\nuser?.UpdateLastLoginDate();\n\n\/\/ \u6761\u4ef6\u4ed8\u304d\u3067\u30a4\u30d9\u30f3\u30c8\u767a\u751f\nOnUserUpdated?.Invoke(this, eventArgs);<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-25\">3. \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u968e\u5c64\u7684\u306a\u8a2d\u5b9a<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class ConfigurationManager\n{\n    public string GetSetting(string key)\n    {\n        return _userSettings?[key] \n            ?? _appSettings?[key] \n            ?? _defaultSettings[key];\n    }\n}<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001if\u6587\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-26\">if\u6587\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-27\">\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u308b\u30cd\u30b9\u30c8\u306e\u524a\u6e1b<\/h3>\n\n\n\n<p>\u6df1\u3044\u30cd\u30b9\u30c8\u306f\u53ef\u8aad\u6027\u3092\u4f4e\u4e0b\u3055\u305b\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u3068\u306a\u308a\u307e\u3059\u3002\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3068\u4fdd\u5b88\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-28\">1. \u60aa\u3044\u4f8b\uff08\u30cd\u30b9\u30c8\u304c\u6df1\u3044\uff09<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public bool ProcessOrder(Order order)\n{\n    if (order != null)\n    {\n        if (order.Items.Any())\n        {\n            if (order.PaymentStatus == PaymentStatus.Verified)\n            {\n                if (CheckInventory(order))\n                {\n                    \/\/ \u6ce8\u6587\u51e6\u7406\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-29\">2. \u826f\u3044\u4f8b\uff08\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\uff09<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public bool ProcessOrder(Order order)\n{\n    if (order == null)\n        return false;\n\n    if (!order.Items.Any())\n        return false;\n\n    if (order.PaymentStatus != PaymentStatus.Verified)\n        return false;\n\n    if (!CheckInventory(order))\n        return false;\n\n    \/\/ \u6ce8\u6587\u51e6\u7406\n    return true;\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-30\">\u30ac\u30fc\u30c9\u7bc0\u306b\u3088\u308b\u53ef\u8aad\u6027\u306e\u5411\u4e0a<\/h3>\n\n\n\n<p>\u30ac\u30fc\u30c9\u7bc0\u306f\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u5148\u982d\u3067\u7570\u5e38\u7cfb\u3084\u5883\u754c\u6761\u4ef6\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u65e9\u671f\u306b\u30ea\u30bf\u30fc\u30f3\u3059\u308b\u624b\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class DocumentProcessor\n{\n    public ProcessingResult ProcessDocument(Document document, User user)\n    {\n        \/\/ \u30ac\u30fc\u30c9\u7bc0\u306b\u3088\u308b\u5165\u529b\u691c\u8a3c\n        if (document == null)\n            throw new ArgumentNullException(nameof(document));\n\n        if (user == null)\n            throw new ArgumentNullException(nameof(user));\n\n        if (!user.HasPermission(Permission.DocumentProcessing))\n            return ProcessingResult.AccessDenied;\n\n        if (document.IsLocked)\n            return ProcessingResult.DocumentLocked;\n\n        \/\/ \u30e1\u30a4\u30f3\u306e\u51e6\u7406\u30ed\u30b8\u30c3\u30af\n        return PerformDocumentProcessing(document);\n    }\n}<\/pre>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u30ac\u30fc\u30c9\u7bc0\u306e\u5229\u70b9<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308b<\/li>\n\n\n\n<li>\u7570\u5e38\u7cfb\u306e\u51e6\u7406\u304c\u4e0a\u90e8\u306b\u307e\u3068\u307e\u308b<\/li>\n\n\n\n<li>\u30e1\u30a4\u30f3\u30ed\u30b8\u30c3\u30af\u306e\u30cd\u30b9\u30c8\u304c\u6e1b\u5c11\u3059\u308b<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-31\">\u6761\u4ef6\u5f0f\u306e\u6700\u9069\u306a\u8a18\u8ff0\u65b9\u6cd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-32\">1. \u6761\u4ef6\u5f0f\u306e\u7c21\u6f54\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\nif (isValid == true)  \/\/ \u5197\u9577\nif (count != 0)       \/\/ \u76f4\u611f\u7684\u3067\u306a\u3044\n\n\/\/ \u826f\u3044\u4f8b\nif (isValid)\nif (count &gt; 0)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-33\">2. \u8907\u5408\u6761\u4ef6\u306e\u6574\u7406<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u7406\u89e3\u3057\u3065\u3089\u3044\uff09\nif (age &gt;= 20 &amp;&amp; !hasLicense == false &amp;&amp; (isStudent || hasPermission) &amp;&amp; status == \"active\")\n\n\/\/ \u826f\u3044\u4f8b\uff08\u8ad6\u7406\u7684\u306b\u30b0\u30eb\u30fc\u30d7\u5316\uff09\nbool isQualified = age &gt;= 20 &amp;&amp; hasLicense;\nbool hasAccess = isStudent || hasPermission;\n\nif (isQualified &amp;&amp; hasAccess &amp;&amp; status == \"active\")\n{\n    \/\/ \u51e6\u7406\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-34\">3. \u6761\u4ef6\u5f0f\u306e\u62bd\u8c61\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class UserEligibilityChecker\n{\n    private bool IsEligibleAge(int age) =&gt; age &gt;= 18;\n\n    private bool HasValidDocuments(User user)\n    {\n        return user.HasIdentification \n            &amp;&amp; user.DocumentsVerified;\n    }\n\n    private bool IsAccountActive(User user)\n    {\n        return user.Status == AccountStatus.Active \n            &amp;&amp; !user.IsBlocked;\n    }\n\n    public bool CanAccessService(User user)\n    {\n        return IsEligibleAge(user.Age)\n            &amp;&amp; HasValidDocuments(user)\n            &amp;&amp; IsAccountActive(user);\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-35\">\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-36\">1. \u6761\u4ef6\u5f0f\u306e\u547d\u540d\u898f\u5247<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u771f\u507d\u5024\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u8cea\u554f\u5f62\u5f0f\u306e\u547d\u540d\u306b\u3059\u308b\npublic bool IsValid();\npublic bool HasPermission();\npublic bool CanProcess();<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-37\">2. \u5426\u5b9a\u6761\u4ef6\u306e\u6700\u5c0f\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u4e8c\u91cd\u5426\u5b9a\u3067\u7406\u89e3\u3057\u3065\u3089\u3044\uff09\nif (!isNotValid)\n\n\/\/ \u826f\u3044\u4f8b\nif (isValid)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-38\">3. \u30c7\u30d5\u30a9\u30eb\u30c8\u30b1\u30fc\u30b9\u306e\u660e\u78ba\u5316<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public string GetUserType(User user)\n{\n    \/\/ \u7279\u6b8a\u306a\u30b1\u30fc\u30b9\u3092\u5148\u306b\u51e6\u7406\n    if (user.IsAdmin) return \"Administrator\";\n    if (user.IsModerator) return \"Moderator\";\n\n    \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u30b1\u30fc\u30b9\n    return \"Regular User\";\n}<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u4fdd\u5b88\u6027\u304c\u9ad8\u304f\u3001\u7406\u89e3\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001if\u6587\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-39\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305fif\u6587\u306e\u5b9f\u88c5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-40\">\u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u9806\u5e8f\u306e\u6700\u9069\u5316<\/h3>\n\n\n\n<p>\u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u9806\u5e8f\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u52b9\u7387\u7684\u306a\u6761\u4ef6\u5f0f\u306e\u8a18\u8ff0\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-41\">1. \u77ed\u7d61\u8a55\u4fa1\uff08Short-circuit Evaluation\uff09\u306e\u6d3b\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public bool ValidateUser(User user)\n{\n    \/\/ \u60aa\u3044\u4f8b\uff1a\u91cd\u3044\u51e6\u7406\u304c\u5e38\u306b\u5b9f\u884c\u3055\u308c\u308b\n    if (CheckUserDatabase() &amp;&amp; user.Name == \"Admin\")\n    {\n        return true;\n    }\n\n    \/\/ \u826f\u3044\u4f8b\uff1a\u8efd\u3044\u51e6\u7406\u3092\u5148\u306b\u8a55\u4fa1\n    if (user.Name == \"Admin\" &amp;&amp; CheckUserDatabase())\n    {\n        return true;\n    }\n}\n\n\/\/ \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a2\u30af\u30bb\u30b9\u3092\u542b\u3080\u91cd\u3044\u51e6\u7406\nprivate bool CheckUserDatabase()\n{\n    \/\/ \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u8a3c\u51e6\u7406\n    return true;\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-42\">2. \u983b\u5ea6\u30d9\u30fc\u30b9\u306e\u6761\u4ef6\u9806\u5e8f\u4ed8\u3051<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public void ProcessOrder(Order order)\n{\n    \/\/ \u60aa\u3044\u4f8b\uff1a\u983b\u5ea6\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\n    if (order.IsSpecialOrder)  \/\/ \u767a\u751f\u983b\u5ea65%\n    {\n        ProcessSpecialOrder(order);\n    }\n    else if (order.IsNormalOrder)  \/\/ \u767a\u751f\u983b\u5ea690%\n    {\n        ProcessNormalOrder(order);\n    }\n    else if (order.IsDiscountOrder)  \/\/ \u767a\u751f\u983b\u5ea65%\n    {\n        ProcessDiscountOrder(order);\n    }\n\n    \/\/ \u826f\u3044\u4f8b\uff1a\u6700\u3082\u983b\u5ea6\u306e\u9ad8\u3044\u6761\u4ef6\u3092\u6700\u521d\u306b\u8a55\u4fa1\n    if (order.IsNormalOrder)  \/\/ \u767a\u751f\u983b\u5ea690%\n    {\n        ProcessNormalOrder(order);\n    }\n    else if (order.IsSpecialOrder)  \/\/ \u767a\u751f\u983b\u5ea65%\n    {\n        ProcessSpecialOrder(order);\n    }\n    else if (order.IsDiscountOrder)  \/\/ \u767a\u751f\u983b\u5ea65%\n    {\n        ProcessDiscountOrder(order);\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-43\">\u5206\u5c90\u4e88\u6e2c\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5f0f\u306e\u914d\u7f6e<\/h3>\n\n\n\n<p>\u73fe\u4ee3\u306eCPU\u306f\u5206\u5c90\u4e88\u6e2c\u6a5f\u80fd\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u6761\u4ef6\u5206\u5c90\u306e\u7d50\u679c\u3092\u4e88\u6e2c\u3059\u308b\u3053\u3068\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-44\">1. \u4e88\u6e2c\u53ef\u80fd\u306a\u6761\u4ef6\u5206\u5c90\u306e\u4f5c\u6210<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public void ProcessItems(List&lt;Item&gt; items)\n{\n    \/\/ \u60aa\u3044\u4f8b\uff1a\u30e9\u30f3\u30c0\u30e0\u306a\u6761\u4ef6\u306b\u3088\u308b\u5206\u5c90\n    foreach (var item in items)\n    {\n        if (new Random().Next(100) &gt; 50)  \/\/ \u4e88\u6e2c\u4e0d\u53ef\u80fd\n        {\n            ProcessHighPriority(item);\n        }\n        else\n        {\n            ProcessLowPriority(item);\n        }\n    }\n\n    \/\/ \u826f\u3044\u4f8b\uff1a\u30bd\u30fc\u30c8\u6e08\u307f\u30c7\u30fc\u30bf\u306b\u3088\u308b\u4e88\u6e2c\u53ef\u80fd\u306a\u5206\u5c90\n    var sortedItems = items.OrderBy(x =&gt; x.Priority).ToList();\n    foreach (var item in sortedItems)\n    {\n        if (item.Priority &gt; 50)  \/\/ \u4e88\u6e2c\u53ef\u80fd\n        {\n            ProcessHighPriority(item);\n        }\n        else\n        {\n            ProcessLowPriority(item);\n        }\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-45\">2. \u6761\u4ef6\u5206\u5c90\u306e\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class PerformanceOptimizedProcessor\n{\n    private readonly Dictionary&lt;ItemType, Action&lt;Item&gt;&gt; _processors;\n\n    public PerformanceOptimizedProcessor()\n    {\n        _processors = new Dictionary&lt;ItemType, Action&lt;Item&gt;&gt;\n        {\n            { ItemType.Normal, ProcessNormalItem },\n            { ItemType.Special, ProcessSpecialItem },\n            { ItemType.Discount, ProcessDiscountItem }\n        };\n    }\n\n    \/\/ \u826f\u3044\u4f8b\uff1a\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u4f7f\u7528\u3057\u305f\u9ad8\u901f\u306a\u30eb\u30c3\u30af\u30a2\u30c3\u30d7\n    public void ProcessItem(Item item)\n    {\n        if (_processors.TryGetValue(item.Type, out var processor))\n        {\n            processor(item);\n        }\n        else\n        {\n            ProcessDefaultItem(item);\n        }\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-46\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-47\">1. \u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6d3b\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class CachedValidator\n{\n    private readonly Dictionary&lt;string, bool&gt; _validationCache\n        = new Dictionary&lt;string, bool&gt;();\n\n    public bool ValidateWithCache(string key)\n    {\n        if (_validationCache.TryGetValue(key, out bool result))\n        {\n            return result;\n        }\n\n        result = PerformExpensiveValidation(key);\n        _validationCache[key] = result;\n        return result;\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-48\">2. \u8a08\u7b97\u30b3\u30b9\u30c8\u306e\u524a\u6e1b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class OptimizedCalculator\n{\n    \/\/ \u60aa\u3044\u4f8b\uff1a\u6bce\u56de\u8a08\u7b97\u3092\u5b9f\u884c\n    public double CalculateValue(int x)\n    {\n        if (Math.Pow(x, 2) &gt; 100)\n        {\n            return Math.Pow(x, 2);\n        }\n        return x;\n    }\n\n    \/\/ \u826f\u3044\u4f8b\uff1a\u8a08\u7b97\u7d50\u679c\u3092\u518d\u5229\u7528\n    public double CalculateValueOptimized(int x)\n    {\n        var squared = x * x;  \/\/ \u4e00\u5ea6\u3060\u3051\u8a08\u7b97\n        if (squared &gt; 100)\n        {\n            return squared;\n        }\n        return x;\n    }\n}<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6700\u9069\u5316\u6280\u8853\u3092\u9069\u5207\u306b\u9069\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u904e\u5ea6\u306a\u6700\u9069\u5316\u306f\u53ef\u8aad\u6027\u3092\u640d\u306a\u3046\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u9069\u5207\u306a\u30d0\u30e9\u30f3\u30b9\u3092\u53d6\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<br>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001if\u6587\u306e\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-49\">if\u6587\u306e\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-50\">switch\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3068switch\u5f0f\u306e\u6d3b\u7528<\/h3>\n\n\n\n<p>\u5f93\u6765\u306eif-else\u6587\u306e\u4ee3\u66ff\u3068\u3057\u3066\u3001\u3088\u308a\u898b\u3084\u3059\u304f\u4fdd\u5b88\u3057\u3084\u3059\u3044switch\u6587\u3084switch\u5f0f\u3092\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-51\">1. \u30e2\u30c0\u30f3\u306aswitch\u5f0f\u306e\u4f7f\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public decimal CalculateDiscount(CustomerType type, decimal amount)\n{\n    \/\/ \u5f93\u6765\u306eif-else\n    if (type == CustomerType.Regular)\n        return amount * 0.1m;\n    else if (type == CustomerType.Premium)\n        return amount * 0.2m;\n    else if (type == CustomerType.VIP)\n        return amount * 0.3m;\n    else\n        return 0m;\n\n    \/\/ \u30e2\u30c0\u30f3\u306aswitch\u5f0f\n    return type switch\n    {\n        CustomerType.Regular =&gt; amount * 0.1m,\n        CustomerType.Premium =&gt; amount * 0.2m,\n        CustomerType.VIP =&gt; amount * 0.3m,\n        _ =&gt; 0m\n    };\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-52\">2. \u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u6d3b\u7528\u3057\u305fswitch<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public string DescribeShape(Shape shape)\n{\n    return shape switch\n    {\n        Circle c when c.Radius &gt; 10 =&gt; $\"\u5927\u304d\u306a\u5186\uff08\u534a\u5f84: {c.Radius}\uff09\",\n        Circle c =&gt; $\"\u5186\uff08\u534a\u5f84: {c.Radius}\uff09\",\n        Rectangle r when r.Width == r.Height =&gt; $\"\u6b63\u65b9\u5f62\uff08\u8fba: {r.Width}\uff09\",\n        Rectangle r =&gt; $\"\u9577\u65b9\u5f62\uff08\u5e45: {r.Width}, \u9ad8\u3055: {r.Height}\uff09\",\n        Triangle t =&gt; $\"\u4e09\u89d2\u5f62\uff08\u5e95\u8fba: {t.Base}, \u9ad8\u3055: {t.Height}\uff09\",\n        _ =&gt; \"\u4e0d\u660e\u306a\u56f3\u5f62\"\n    };\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-53\">\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90<\/h3>\n\n\n\n<p>C# 9.0\u4ee5\u964d\u3067\u5c0e\u5165\u3055\u308c\u305f\u65b0\u3057\u3044\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u8868\u73fe\u529b\u8c4a\u304b\u306a\u6761\u4ef6\u5206\u5c90\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-54\">1. \u30d7\u30ed\u30d1\u30c6\u30a3\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public string ValidateOrder(Order order)\n{\n    return order switch\n    {\n        { TotalAmount: &gt; 10000, IsVIP: true } =&gt; \"VIP\u9ad8\u984d\u6ce8\u6587\",\n        { TotalAmount: &gt; 10000 } =&gt; \"\u9ad8\u984d\u6ce8\u6587\",\n        { IsVIP: true } =&gt; \"VIP\u6ce8\u6587\",\n        { Items.Count: 0 } =&gt; \"\u7a7a\u306e\u6ce8\u6587\",\n        _ =&gt; \"\u901a\u5e38\u6ce8\u6587\"\n    };\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-55\">2. \u30bf\u30d7\u30eb\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public string GetSeasonalGreeting((int month, int day) date)\n{\n    return date switch\n    {\n        (12, 25) =&gt; \"\u30e1\u30ea\u30fc\u30af\u30ea\u30b9\u30de\u30b9\uff01\",\n        (1, 1) =&gt; \"\u3042\u3051\u307e\u3057\u3066\u304a\u3081\u3067\u3068\u3046\uff01\",\n        (3, &gt;= 1 and &lt;= 3) =&gt; \"\u3072\u306a\u796d\u308a\u30b7\u30fc\u30ba\u30f3\",\n        (_, _) when date.month == 12 =&gt; \"\u5e2b\u8d70\u3067\u3059\",\n        _ =&gt; \"\u901a\u5e38\u55b6\u696d\u65e5\u3067\u3059\"\n    };\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-56\">\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u6d3b\u7528\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u7f6e\u304d\u63db\u3048<\/h3>\n\n\n\n<p>\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u306f\u3001\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3088\u308a\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-57\">1. Strategy\u30d1\u30bf\u30fc\u30f3\u306e\u6d3b\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u5b9a\u7fa9\npublic interface IDiscountStrategy\n{\n    decimal CalculateDiscount(decimal amount);\n}\n\n\/\/ \u5177\u4f53\u7684\u306a\u6226\u7565\u306e\u5b9f\u88c5\npublic class RegularDiscount : IDiscountStrategy\n{\n    public decimal CalculateDiscount(decimal amount) =&gt; amount * 0.1m;\n}\n\npublic class PremiumDiscount : IDiscountStrategy\n{\n    public decimal CalculateDiscount(decimal amount) =&gt; amount * 0.2m;\n}\n\npublic class VIPDiscount : IDiscountStrategy\n{\n    public decimal CalculateDiscount(decimal amount) =&gt; amount * 0.3m;\n}\n\n\/\/ \u6226\u7565\u306e\u4f7f\u7528\npublic class DiscountCalculator\n{\n    private readonly Dictionary&lt;CustomerType, IDiscountStrategy&gt; _strategies;\n\n    public DiscountCalculator()\n    {\n        _strategies = new Dictionary&lt;CustomerType, IDiscountStrategy&gt;\n        {\n            { CustomerType.Regular, new RegularDiscount() },\n            { CustomerType.Premium, new PremiumDiscount() },\n            { CustomerType.VIP, new VIPDiscount() }\n        };\n    }\n\n    public decimal CalculateDiscount(CustomerType type, decimal amount)\n    {\n        return _strategies.TryGetValue(type, out var strategy)\n            ? strategy.CalculateDiscount(amount)\n            : 0m;\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-58\">2. State \u30d1\u30bf\u30fc\u30f3\u306e\u6d3b\u7528<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public interface IOrderState\n{\n    void Process(Order order);\n    IOrderState NextState();\n}\n\npublic class NewOrderState : IOrderState\n{\n    public void Process(Order order)\n    {\n        \/\/ \u65b0\u898f\u6ce8\u6587\u306e\u51e6\u7406\n        Console.WriteLine(\"\u65b0\u898f\u6ce8\u6587\u3092\u51e6\u7406\u4e2d\");\n    }\n\n    public IOrderState NextState() =&gt; new ProcessingState();\n}\n\npublic class ProcessingState : IOrderState\n{\n    public void Process(Order order)\n    {\n        \/\/ \u51e6\u7406\u4e2d\u306e\u6ce8\u6587\u306e\u51e6\u7406\n        Console.WriteLine(\"\u6ce8\u6587\u51e6\u7406\u4e2d\");\n    }\n\n    public IOrderState NextState() =&gt; new CompletedState();\n}\n\npublic class Order\n{\n    private IOrderState _state;\n\n    public Order()\n    {\n        _state = new NewOrderState();\n    }\n\n    public void Process()\n    {\n        _state.Process(this);\n        _state = _state.NextState();\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-59\">\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\u9078\u629e\u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3<\/h4>\n\n\n\n<div class=\"wp-block-sgb-box sng-box box6\">\n<ol class=\"wp-block-list is-style-sango-list-simple\">\n<li>switch\u5f0f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\n<ul class=\"wp-block-list is-style-sango-list-simple\">\n<li>\u5358\u7d14\u306a\u5024\u306e\u5206\u5c90<\/li>\n\n\n\n<li>\u623b\u308a\u5024\u306e\u578b\u304c\u540c\u3058\u5834\u5408<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u6d3b\u7528\u3057\u305f\u3044\u5834\u5408<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\n<ul class=\"wp-block-list is-style-sango-list-simple\">\n<li>\u8907\u96d1\u306a\u30ed\u30b8\u30c3\u30af\u3092\u542b\u3080\u5834\u5408<\/li>\n\n\n\n<li>\u65b0\u3057\u3044\u7a2e\u985e\u306e\u8ffd\u52a0\u304c\u983b\u7e41\u306b\u767a\u751f\u3059\u308b\u5834\u5408<\/li>\n\n\n\n<li>\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306e\u5206\u96e2\u304c\u5fc5\u8981\u306a\u5834\u5408<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\u3092\u9069\u5207\u306b\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u4fdd\u5b88\u6027\u304c\u9ad8\u304f\u3001\u62e1\u5f35\u6027\u306e\u3042\u308b\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u5b9f\u969b\u306e\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306b\u9069\u7528\u3059\u308b\u4f8b\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-60\">\u5b9f\u8df5\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3068\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-61\">\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306b\u304a\u3051\u308b\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u4f8b<\/h3>\n\n\n\n<p>\u5b9f\u969b\u306e\u30d3\u30b8\u30cd\u30b9\u30b7\u30fc\u30f3\u3067\u306f\u3001\u8907\u96d1\u306a\u8981\u4ef6\u3092\u6e80\u305f\u3059\u305f\u3081\u306b\u6761\u4ef6\u5206\u5c90\u3092\u9069\u5207\u306b\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4ee5\u4e0b\u3067\u306f\u3001\u5b9f\u8df5\u7684\u306a\u4f8b\u3092\u901a\u3058\u3066\u52b9\u679c\u7684\u306a\u5b9f\u88c5\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-62\">\u6ce8\u6587\u51e6\u7406\u30b7\u30b9\u30c6\u30e0\u306e\u5b9f\u88c5\u4f8b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class OrderProcessor\n{\n    private readonly ILogger _logger;\n    private readonly IInventoryService _inventoryService;\n    private readonly IPaymentService _paymentService;\n\n    public OrderProcessor(\n        ILogger logger,\n        IInventoryService inventoryService,\n        IPaymentService paymentService)\n    {\n        _logger = logger;\n        _inventoryService = inventoryService;\n        _paymentService = paymentService;\n    }\n\n    public async Task&lt;OrderResult&gt; ProcessOrder(Order order)\n    {\n        \/\/ \u30ac\u30fc\u30c9\u7bc0\u306b\u3088\u308b\u5165\u529b\u691c\u8a3c\n        if (order == null)\n            throw new ArgumentNullException(nameof(order));\n\n        if (!order.Items.Any())\n            return OrderResult.Failed(\"\u6ce8\u6587\u9805\u76ee\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\");\n\n        try\n        {\n            \/\/ \u5728\u5eab\u30c1\u30a7\u30c3\u30af\n            foreach (var item in order.Items)\n            {\n                var stockResult = await _inventoryService.CheckStock(item.ProductId, item.Quantity);\n                if (!stockResult.IsAvailable)\n                    return OrderResult.Failed($\"\u5546\u54c1 {item.ProductId} \u306e\u5728\u5eab\u304c\u4e0d\u8db3\u3057\u3066\u3044\u307e\u3059\");\n            }\n\n            \/\/ \u652f\u6255\u3044\u51e6\u7406\n            var paymentResult = await ProcessPayment(order);\n            if (!paymentResult.IsSuccess)\n                return OrderResult.Failed($\"\u652f\u6255\u3044\u51e6\u7406\u306b\u5931\u6557\u3057\u307e\u3057\u305f: {paymentResult.Message}\");\n\n            \/\/ \u6ce8\u6587\u78ba\u5b9a\u51e6\u7406\n            await FinalizeOrder(order);\n\n            return OrderResult.Success(\"\u6ce8\u6587\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\");\n        }\n        catch (Exception ex)\n        {\n            _logger.LogError(ex, \"\u6ce8\u6587\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\");\n            return OrderResult.Failed(\"\u30b7\u30b9\u30c6\u30e0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\");\n        }\n    }\n\n    private async Task&lt;PaymentResult&gt; ProcessPayment(Order order)\n    {\n        return order.PaymentMethod switch\n        {\n            PaymentMethod.CreditCard =&gt; await ProcessCreditCardPayment(order),\n            PaymentMethod.BankTransfer =&gt; await ProcessBankTransfer(order),\n            PaymentMethod.PointPayment when order.Customer.Points &gt;= order.TotalAmount \n                =&gt; await ProcessPointPayment(order),\n            _ =&gt; PaymentResult.Failed(\"\u672a\u5bfe\u5fdc\u306e\u652f\u6255\u3044\u65b9\u6cd5\u3067\u3059\")\n        };\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-63\">\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3067\u306eif\u6587\u306e\u4f7f\u7528\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5805\u7262\u6027\u3092\u78ba\u4fdd\u3059\u308b\u4e0a\u3067\u91cd\u8981\u3067\u3059\u3002<br>\u4ee5\u4e0b\u3067\u306f\u3001\u52b9\u679c\u7684\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-64\">1. Result\u578b\u3092\u4f7f\u7528\u3057\u305f\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class Result&lt;T&gt;\n{\n    public bool IsSuccess { get; }\n    public T Value { get; }\n    public string Error { get; }\n\n    private Result(bool isSuccess, T value, string error)\n    {\n        IsSuccess = isSuccess;\n        Value = value;\n        Error = error;\n    }\n\n    public static Result&lt;T&gt; Success(T value) =&gt; new(true, value, null);\n    public static Result&lt;T&gt; Failure(string error) =&gt; new(false, default, error);\n}\n\npublic class UserService\n{\n    private readonly IUserRepository _repository;\n    private readonly IPasswordHasher _passwordHasher;\n\n    public async Task&lt;Result&lt;User&gt;&gt; RegisterUser(UserRegistration registration)\n    {\n        \/\/ \u5165\u529b\u691c\u8a3c\n        if (string.IsNullOrEmpty(registration.Email))\n            return Result&lt;User&gt;.Failure(\"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u5fc5\u9808\u3067\u3059\");\n\n        if (string.IsNullOrEmpty(registration.Password))\n            return Result&lt;User&gt;.Failure(\"\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5fc5\u9808\u3067\u3059\");\n\n        try\n        {\n            \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u91cd\u8907\u30c1\u30a7\u30c3\u30af\n            if (await _repository.ExistsAsync(registration.Email))\n                return Result&lt;User&gt;.Failure(\"\u3053\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u65e2\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\");\n\n            \/\/ \u30e6\u30fc\u30b6\u30fc\u4f5c\u6210\n            var user = new User\n            {\n                Email = registration.Email,\n                PasswordHash = _passwordHasher.HashPassword(registration.Password)\n            };\n\n            await _repository.CreateAsync(user);\n            return Result&lt;User&gt;.Success(user);\n        }\n        catch (Exception ex)\n        {\n            return Result&lt;User&gt;.Failure($\"\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {ex.Message}\");\n        }\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-65\">\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u8a2d\u8a08<\/h3>\n\n\n\n<p>\u30c6\u30b9\u30c8\u53ef\u80fd\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u306f\u3001\u54c1\u8cea\u7dad\u6301\u306e\u89b3\u70b9\u3067\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002<br>\u4ee5\u4e0b\u3067\u306f\u3001\u30c6\u30b9\u30c8\u53ef\u80fd\u6027\u3092\u8003\u616e\u3057\u305f\u8a2d\u8a08\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-66\">1. \u30c6\u30b9\u30c8\u53ef\u80fd\u306a\u8a2d\u8a08\u4f8b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public interface IDiscountCalculator\n{\n    decimal CalculateDiscount(Order order);\n}\n\npublic class OrderDiscountCalculator : IDiscountCalculator\n{\n    private readonly ICustomerService _customerService;\n    private readonly IPromotionService _promotionService;\n\n    public OrderDiscountCalculator(\n        ICustomerService customerService,\n        IPromotionService promotionService)\n    {\n        _customerService = customerService;\n        _promotionService = promotionService;\n    }\n\n    public decimal CalculateDiscount(Order order)\n    {\n        var discount = 0m;\n\n        \/\/ \u9867\u5ba2\u30e9\u30f3\u30af\u306b\u3088\u308b\u5272\u5f15\n        var customerDiscount = GetCustomerDiscount(order.CustomerId);\n        if (customerDiscount &gt; 0)\n            discount += customerDiscount;\n\n        \/\/ \u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u5272\u5f15\n        var promotionDiscount = GetPromotionDiscount(order);\n        if (promotionDiscount &gt; 0)\n            discount += promotionDiscount;\n\n        \/\/ \u6700\u5927\u5272\u5f15\u984d\u306e\u30c1\u30a7\u30c3\u30af\n        return Math.Min(discount, order.TotalAmount * 0.5m);\n    }\n\n    private decimal GetCustomerDiscount(int customerId)\n    {\n        var customer = _customerService.GetCustomer(customerId);\n        return customer?.Rank switch\n        {\n            CustomerRank.Silver =&gt; 0.05m,\n            CustomerRank.Gold =&gt; 0.1m,\n            CustomerRank.Platinum =&gt; 0.15m,\n            _ =&gt; 0m\n        };\n    }\n\n    private decimal GetPromotionDiscount(Order order)\n    {\n        var activePromotions = _promotionService.GetActivePromotions();\n        return activePromotions\n            .Where(p =&gt; p.IsApplicable(order))\n            .Sum(p =&gt; p.CalculateDiscount(order));\n    }\n}\n\n\/\/ \u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306e\u4f8b\npublic class OrderDiscountCalculatorTests\n{\n    [Fact]\n    public void CalculateDiscount_GoldCustomerWithPromotion_ReturnsCorrectDiscount()\n    {\n        \/\/ Arrange\n        var customerService = Substitute.For&lt;ICustomerService&gt;();\n        customerService.GetCustomer(Arg.Any&lt;int&gt;())\n            .Returns(new Customer { Rank = CustomerRank.Gold });\n\n        var promotionService = Substitute.For&lt;IPromotionService&gt;();\n        promotionService.GetActivePromotions()\n            .Returns(new[] { new FixedAmountPromotion(1000m) });\n\n        var calculator = new OrderDiscountCalculator(\n            customerService, promotionService);\n\n        var order = new Order { \n            CustomerId = 1, \n            TotalAmount = 10000m \n        };\n\n        \/\/ Act\n        var discount = calculator.CalculateDiscount(order);\n\n        \/\/ Assert\n        Assert.Equal(2000m, discount); \/\/ 10% + 1000\u5186\u306e\u5272\u5f15\n    }\n}<\/pre>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ol class=\"wp-block-list\">\n<li>\u4f9d\u5b58\u6027\u6ce8\u5165\u306e\u6d3b\u7528\n<ul class=\"wp-block-list\">\n<li>\u30c6\u30b9\u30c8\u6642\u306b\u4f9d\u5b58\u30b5\u30fc\u30d3\u30b9\u3092\u30e2\u30c3\u30af\u5316\u3067\u304d\u308b<\/li>\n\n\n\n<li>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u306e\u7d50\u5408\u5ea6\u3092\u4f4e\u304f\u4fdd\u3064<\/li>\n\n\n\n<li>\u5358\u4e00\u8cac\u4efb\u306e\u539f\u5247\u3092\u5b88\u308b<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u968e\u5c64\u5316\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5c64\u3067\u306e\u696d\u52d9\u4f8b\u5916\u306e\u51e6\u7406<\/li>\n\n\n\n<li>\u30a4\u30f3\u30d5\u30e9\u5c64\u3067\u306e\u6280\u8853\u7684\u4f8b\u5916\u306e\u51e6\u7406<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u30ed\u30b0\u8a18\u9332\u3068\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u63d0\u4f9b<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30c6\u30b9\u30bf\u30d3\u30ea\u30c6\u30a3\u306e\u78ba\u4fdd\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30d6\u30ea\u30c3\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u660e\u78ba\u306a\u5b9a\u7fa9<\/li>\n\n\n\n<li>\u526f\u4f5c\u7528\u306e\u5206\u96e2<\/li>\n\n\n\n<li>\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u8a2d\u8a08<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div><\/div>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5b9f\u8df5\u7684\u306a\u4f8b\u3092\u53c2\u8003\u306b\u3001\u3088\u308a\u5805\u7262\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-67\">if\u6587\u306e\u307e\u3068\u3081<\/h2>\n\n\n\n<p>if\u6587\u306f\u6761\u4ef6\u5206\u5c90\u306e\u57fa\u672c\u3067\u3042\u308a\u306a\u304c\u3089\u3001\u9069\u5207\u306a\u4f7f\u7528\u306b\u306f\u69d8\u3005\u306a\u8003\u616e\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3001\u53ef\u8aad\u6027\u3001\u4fdd\u5b88\u6027\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u53d6\u308a\u306a\u304c\u3089\u3001\u30e2\u30c0\u30f3\u306aC#\u306e\u6a5f\u80fd\u3082\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u8cea\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u624b\u6cd5\u3092\u5b9f\u8df5\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u304c\u53ef\u80fd\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u3053\u306e\u8a18\u4e8b\u306e\u4e3b\u306a\u30dd\u30a4\u30f3\u30c8<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>\u6761\u4ef6\u5206\u5c90\u306e\u57fa\u672c\u3092\u62bc\u3055\u3048\u3064\u3064\u3001\u5b9f\u8df5\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u307e\u3067\u6bb5\u968e\u7684\u306b\u89e3\u8aac<\/li>\n\n\n\n<li>\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u3084\u30ac\u30fc\u30c9\u7bc0\u306a\u3069\u306b\u3088\u308b\u53ef\u8aad\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9<\/li>\n\n\n\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u610f\u8b58\u3057\u305f\u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u9806\u5e8f\u3068\u5b9f\u88c5\u65b9\u6cd5<\/li>\n\n\n\n<li>switch\u5f0f\u3084\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306a\u3069\u306e\u30e2\u30c0\u30f3\u306aC#\u6a5f\u80fd\u306e\u6d3b\u7528<\/li>\n\n\n\n<li>\u5b9f\u52d9\u3067\u4f7f\u3048\u308b\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3\u3068\u30c6\u30b9\u30c8\u53ef\u80fd\u306a\u8a2d\u8a08\u624b\u6cd5<\/li>\n<\/ul>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2818,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,61],"tags":[],"class_list":{"0":"post-1974","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-csharp","8":"category-csharp-syntax"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/1974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1974"}],"version-history":[{"count":2,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/1974\/revisions"}],"predecessor-version":[{"id":1993,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/1974\/revisions\/1993"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/media\/2818"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}