<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>노초코의 주경야독</title>
    <link>https://nochoco-lee.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Thu, 9 Apr 2026 20:14:52 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>노초코</managingEditor>
    <item>
      <title>49.3: 명명된 인자 (Named Argument) 를 사용하여 코드를 보다 명확하게 작성하기</title>
      <link>https://nochoco-lee.tistory.com/718</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-493-%EB%AA%85%EB%AA%85%EB%90%9C-%EC%9D%B8%EC%9E%90-named-argument-%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC-%EC%BD%94%EB%93%9C%EB%A5%BC-%EB%B3%B4%EB%8B%A4-%EB%AA%85%ED%99%95%ED%95%98%EA%B2%8C-%EC%9E%91%EC%84%B1%ED%95%98%EA%B8%B0&quot;&gt;Section 49.3: 명명된 인자 (Named Argument) 를 사용하여 코드를 보다 명확하게 작성하기&lt;/h3&gt;
&lt;p&gt;다음과 같은 간단한 클래스가 있는 경우를 생각해 본다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SmsUtil&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SendMessage&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; to, &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; message, &lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; retryCount, &lt;span class=&quot;hljs-keyword&quot;&gt;object&lt;/span&gt; attachment&lt;/span&gt;)&lt;/span&gt;
  {
    &lt;span class=&quot;hljs-comment&quot;&gt;// 추가적인 코드 부분 &lt;/span&gt;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C# 3.0 이전 버전에서의 위 메소드 호출 코드는 다음과 같다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; result = SmsUtil.SendMessage(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Mehran&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;Maryam&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello there!&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;12&lt;/span&gt;, &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;);
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;명명된 인자 (Named Argument) 를 사용하면, 아래와 같이 보다 명확한 코드를 통해 메소드를 호출할 수 있다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; result = SmsUtil.SendMessage(
  &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Mehran&quot;&lt;/span&gt;,
  to: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Maryam&quot;&lt;/span&gt;,
  message &lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello there!&quot;&lt;/span&gt;,
  retryCount: &lt;span class=&quot;hljs-number&quot;&gt;12&lt;/span&gt;,
  attachment: &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;);
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/718</guid>
      <comments>https://nochoco-lee.tistory.com/718#entry718comment</comments>
      <pubDate>Thu, 1 Dec 2022 23:07:52 +0900</pubDate>
    </item>
    <item>
      <title>49.2: 명명된 인자 (Named Argument) 와 선택적 인자 (Optional Parameter)</title>
      <link>https://nochoco-lee.tistory.com/717</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-492-%EB%AA%85%EB%AA%85%EB%90%9C-%EC%9D%B8%EC%9E%90-named-argument-%EC%99%80-%EC%84%A0%ED%83%9D%EC%A0%81-%EC%9D%B8%EC%9E%90-optional-parameter&quot;&gt;Section 49.2: 명명된 인자 (Named Argument) 와 선택적 인자 (Optional Parameter)&lt;/h3&gt;
&lt;p&gt;명명된 인자 (Named Argument) 와 선택적 인자 (Optional Parameter) 는 함께 사용이 가능하다.&lt;/p&gt;
&lt;p&gt;다음과 같은 메소드를 확인한다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SmsUtil&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SendMessage&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; to, &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; message, &lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; retryCount = &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;,
    &lt;span class=&quot;hljs-keyword&quot;&gt;object&lt;/span&gt; attachment = &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-comment&quot;&gt;// 추가적인 코드 부분&lt;/span&gt;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;위 메소드에서, 끝에서 두번째에 위치한 &lt;code&gt;retryCount&lt;/code&gt; 파라미터만 제외한채로 메소드 호출을 하고 싶다면, 다음과 같이 코드를 작성할 수 있다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; result = SmsUtil.SendMessage(
  &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Cihan&quot;&lt;/span&gt;,
  to: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Yakar&quot;&lt;/span&gt;,
  message: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello there!&quot;&lt;/span&gt;,
  attachment: &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;object&lt;/span&gt;());
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/717</guid>
      <comments>https://nochoco-lee.tistory.com/717#entry717comment</comments>
      <pubDate>Thu, 1 Dec 2022 23:06:35 +0900</pubDate>
    </item>
    <item>
      <title>49.1: 순서가 필요없는 명명된 인자 (Named Argument) 사용하기</title>
      <link>https://nochoco-lee.tistory.com/716</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-491-%EC%88%9C%EC%84%9C%EA%B0%80-%ED%95%84%EC%9A%94%EC%97%86%EB%8A%94-%EB%AA%85%EB%AA%85%EB%90%9C-%EC%9D%B8%EC%9E%90-named-argument-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0&quot;&gt;Section 49.1: 순서가 필요없는 명명된 인자 (Named Argument) 사용하기&lt;/h3&gt;
&lt;p&gt;명명된 인자 (Named Argument) 를 사용하면, 인자의 순서를 사용자가 원하는 어떠한 순서대로 기술하여도 정상 동작에 문제가 없다.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Sample&lt;/code&gt; 메소드:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sample&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; left, &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; right&lt;/span&gt;)&lt;/span&gt;
{
  &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;.Join(&lt;span class=&quot;hljs-string&quot;&gt;&quot;-&quot;&lt;/span&gt;,left,right);
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;Sample&lt;/code&gt; 메소드 호출:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;Console.WriteLine (Sample(left:&lt;span class=&quot;hljs-string&quot;&gt;&quot;A&quot;&lt;/span&gt;,right:&lt;span class=&quot;hljs-string&quot;&gt;&quot;B&quot;&lt;/span&gt;));
Console.WriteLine (Sample(right:&lt;span class=&quot;hljs-string&quot;&gt;&quot;A&quot;&lt;/span&gt;,left:&lt;span class=&quot;hljs-string&quot;&gt;&quot;B&quot;&lt;/span&gt;));
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;결과:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;A-B
B-A
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/716</guid>
      <comments>https://nochoco-lee.tistory.com/716#entry716comment</comments>
      <pubDate>Thu, 1 Dec 2022 23:05:37 +0900</pubDate>
    </item>
    <item>
      <title>48.17: 예외적인 특수한 처리를 위해 확장 메소드 이용하기</title>
      <link>https://nochoco-lee.tistory.com/715</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4817-%EC%98%88%EC%99%B8%EC%A0%81%EC%9D%B8-%ED%8A%B9%EC%88%98%ED%95%9C-%EC%B2%98%EB%A6%AC%EB%A5%BC-%EC%9C%84%ED%95%B4-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C-%EC%9D%B4%EC%9A%A9%ED%95%98%EA%B8%B0&quot;&gt;Section 48.17: 예외적인 특수한 처리를 위해 확장 메소드 이용하기&lt;/h3&gt;
&lt;p&gt;확장 메소드는 호출하는 함수를 &lt;code&gt;if&lt;/code&gt;/&lt;code&gt;then&lt;/code&gt; 조합으로 뒤덮일 수도 있는 복잡한 비즈니스 로직을 숨기기 위해 사용될 수 있다. 이는 확장 메소드를 이용해 &lt;code&gt;null&lt;/code&gt; 값을 처리하는 방식과 유사하다. 다음 예제를 확인한다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;CakeExtensions&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; Cake &lt;span class=&quot;hljs-title&quot;&gt;EnsureTrueCake&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; Cake cake&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-comment&quot;&gt;// 만약 이 케익이 가짜라면, 조금 맛이 떨어지긴 하지만 절대 가짜일리는 없는 할머니의 케익으로 대체한다. 만약 이 케익이 가짜가 아니라면, 아무 일도 하지 않고 바로 해당 케익을 반환한다.&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; CakeVerificationService.IsCakeLie(cake) ? GrandmasKitchen.Get1950sCake() : cake;
  }
}
Cake myCake = Bakery.GetNextCake().EnsureTrueCake();
myMouth.Eat(myCake); &lt;span class=&quot;hljs-comment&quot;&gt;// 가짜일 수 있다는 걱정 없이 케익을 바로 먹을 수 있다.&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/715</guid>
      <comments>https://nochoco-lee.tistory.com/715#entry715comment</comments>
      <pubDate>Thu, 1 Dec 2022 23:04:19 +0900</pubDate>
    </item>
    <item>
      <title>48.16: 확장 메소드를 사용하여 새로운 collection 타입 (예:DictList) 생성하기</title>
      <link>https://nochoco-lee.tistory.com/714</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4816-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC-%EC%83%88%EB%A1%9C%EC%9A%B4-collection-%ED%83%80%EC%9E%85-%EC%98%88dictlist-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0&quot;&gt;Section 48.16: 확장 메소드를 사용하여 새로운 collection 타입 (예:DictList) 생성하기&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; 를 값으로 갖는 &lt;code&gt;Dictionary&lt;/code&gt; 와 같은, 새로운 중첩 collection 타입을 확장메소드를 통해 보다 편리하게 사용할 수 있도록 만들 수 있다.&lt;/p&gt;
&lt;p&gt;다음과 같은 확장 메소드가 있다고 가정하면:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;DictListExtensions&lt;/span&gt; {
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; Add &amp;lt; TKey, TValue, TCollection &amp;gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; Dictionary &amp;lt; TKey, TCollection &amp;gt; dict, TKey key, TValue &lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;)
  &lt;span class=&quot;hljs-keyword&quot;&gt;where&lt;/span&gt; TCollection: ICollection &amp;lt; TValue &amp;gt; , &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt;() {
    TCollection list;

    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (!dict.TryGetValue(key, &lt;span class=&quot;hljs-keyword&quot;&gt;out&lt;/span&gt; list)) {
      list = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; TCollection();
      dict.Add(key, list);
    }
    list.Add(&lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;);
  }
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; Remove &amp;lt; TKey, TValue, TCollection &amp;gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; Dictionary &amp;lt; TKey, TCollection &amp;gt; dict,
    TKey key, TValue &lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;)
  &lt;span class=&quot;hljs-keyword&quot;&gt;where&lt;/span&gt; TCollection: ICollection &amp;lt; TValue &amp;gt; {
    TCollection list;
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (!dict.TryGetValue(key, &lt;span class=&quot;hljs-keyword&quot;&gt;out&lt;/span&gt; list)) {
      &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;;
    }
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; ret = list.Remove(&lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;);
    &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (list.Count == &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;) {
      dict.Remove(key);
    }
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; ret;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;위 확장 메소드를 다음과 같이 사용할 수 있다:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; dictList = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;, List&amp;lt;&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt;&amp;gt;&amp;gt;();
dictList.Add(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;);
dictList.Add(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;);
dictList.Add(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;15&lt;/span&gt;);
Console.WriteLine(String.Join(&lt;span class=&quot;hljs-string&quot;&gt;&quot;, &quot;&lt;/span&gt;, dictList[&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;])); &lt;span class=&quot;hljs-comment&quot;&gt;// 5, 10, 15&lt;/span&gt;
dictList.Remove(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;);
dictList.Remove(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;);
Console.WriteLine(String.Join(&lt;span class=&quot;hljs-string&quot;&gt;&quot;, &quot;&lt;/span&gt;, dictList[&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;])); &lt;span class=&quot;hljs-comment&quot;&gt;// 15&lt;/span&gt;
dictList.Remove(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;15&lt;/span&gt;);
Console.WriteLine(dictList.ContainsKey(&lt;span class=&quot;hljs-string&quot;&gt;&quot;example&quot;&lt;/span&gt;)); &lt;span class=&quot;hljs-comment&quot;&gt;// False&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://dotnetfiddle.net/UbdQuC&quot;&gt;데모 확인하기&lt;/a&gt;&lt;/p&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/714</guid>
      <comments>https://nochoco-lee.tistory.com/714#entry714comment</comments>
      <pubDate>Thu, 1 Dec 2022 23:00:28 +0900</pubDate>
    </item>
    <item>
      <title>48.15: 확장 메소드를 사용하여 편리한 mapper 클래스 만들기</title>
      <link>https://nochoco-lee.tistory.com/713</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4815-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC-%ED%8E%B8%EB%A6%AC%ED%95%9C-mapper-%ED%81%B4%EB%9E%98%EC%8A%A4-%EB%A7%8C%EB%93%A4%EA%B8%B0&quot;&gt;Section 48.15: 확장 메소드를 사용하여 편리한 mapper 클래스 만들기&lt;/h3&gt;
&lt;p&gt;확장 (extension) 메소드를 이용하면, 보다 편리한 mapper 클래스를 만들 수 있다. 다음과 같은 DTO 클래스들이 존재하는 경우를 생각해보자.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;UserDTO&lt;/span&gt; {
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; AddressDTO Address {
    &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;;
  }
}
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AddressDTO&lt;/span&gt; {
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; Name {
    &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;이제 각 클래스들을 아래와 같이 대응되는 view model 클래스들로 매핑시켜야 한다.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;UserViewModel&lt;/span&gt; {
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; AddressViewModel Address {
    &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;;
  }
}

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AddressViewModel&lt;/span&gt; {
  &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; Name {
    &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;이러한 경우, 아래와 같은 mapper 클래스를 정의할 수 있다.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ViewModelMapper&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; UserViewModel &lt;span class=&quot;hljs-title&quot;&gt;ToViewModel&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; UserDTO user&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; user == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; ?
      &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; :
      &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; UserViewModel() {
        Address = user.Address.ToViewModel()
        &lt;span class=&quot;hljs-comment&quot;&gt;// Job = user.Job.ToViewModel(),&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot;&gt;// Contact = user.Contact.ToViewModel() .. 기타 등등&lt;/span&gt;
      };
  }
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; AddressViewModel &lt;span class=&quot;hljs-title&quot;&gt;ToViewModel&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; AddressDTO userAddr&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; userAddr == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; ?
      &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; :
      &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; AddressViewModel() {
        Name = userAddr.Name
      };
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;이제, 위에서 정의한 mapper 를 다음과 같이 호출할 수 있다.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt; UserDTO userDTOObj = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; UserDTO() {
   Address = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; AddressDTO() {
     Name = &lt;span class=&quot;hljs-string&quot;&gt;&quot;Address of the user&quot;&lt;/span&gt;
   }
 };
 UserViewModel user = userDTOObj.ToViewModel(); &lt;span class=&quot;hljs-comment&quot;&gt;// DTO 클래스를 Viewmodel 에 매핑시킨다&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;이 방식의 장점은, 모든 매핑 메소드들은 공통된 이름 (&lt;code&gt;ToViewModel&lt;/code&gt;) 을 갖게 될 것이며 이는 다양한 방법으로 재사용될 수 있을 것이다.&lt;/p&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/713</guid>
      <comments>https://nochoco-lee.tistory.com/713#entry713comment</comments>
      <pubDate>Thu, 1 Dec 2022 22:59:29 +0900</pubDate>
    </item>
    <item>
      <title>48.14: 확장 메소드를 통한 강력한 형식 (strongly typed) 의 래퍼 (wrapper) 작성하기</title>
      <link>https://nochoco-lee.tistory.com/712</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4814-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C%EB%A5%BC-%ED%86%B5%ED%95%9C-%EA%B0%95%EB%A0%A5%ED%95%9C-%ED%98%95%EC%8B%9D-strongly-typed-%EC%9D%98-%EB%9E%98%ED%8D%BC-wrapper-%EC%9E%91%EC%84%B1%ED%95%98%EA%B8%B0&quot;&gt;Section 48.14: 확장 메소드를 통한 강력한 형식 (strongly typed) 의 래퍼 (wrapper) 작성하기&lt;/h3&gt;
&lt;p&gt;확장 메소드를 이용하면 &lt;code&gt;Dictionary&lt;/code&gt; 와 유사한 객체들에 대한 강력한 형식 (strongly typed) 기반의 래퍼 (wrapper) 를 작성할 수 있다. 예를 들면 캐시라던가, &lt;code&gt;HttpContext.Items&lt;/code&gt; 등등이 이에 해당한다.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;CacheExtensions&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SetUserInfo&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; Cache cache, UserInfo data&lt;/span&gt;)&lt;/span&gt; =&amp;gt;
    cache[&lt;span class=&quot;hljs-string&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;] = data;
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; UserInfo &lt;span class=&quot;hljs-title&quot;&gt;GetUserInfo&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; Cache cache&lt;/span&gt;)&lt;/span&gt; =&amp;gt;
    cache[&lt;span class=&quot;hljs-string&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;] &lt;span class=&quot;hljs-keyword&quot;&gt;as&lt;/span&gt; UserInfo;
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;이러한 접근 방식은 코드 전반에 걸쳐 스트링 리터럴을 키 (key) 로 사용한다거나 값을 읽을 때 원하는 타입으로의 캐스팅을 해야 한다거나 하는 필요를 없애준다. 종합적으로 보면, 이는 &lt;code&gt;Dictionary&lt;/code&gt; 와 같은 느슨한 형식 (loosely typed) 을 갖는 객체를 보다 안전하고 강력한 형식 (strongly typed) 기반으로 사용할 수 있는 방법을 제공한다.&lt;/p&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/712</guid>
      <comments>https://nochoco-lee.tistory.com/712#entry712comment</comments>
      <pubDate>Thu, 1 Dec 2022 22:57:40 +0900</pubDate>
    </item>
    <item>
      <title>48.13: IList&amp;lt;T&amp;gt; 에 대한 확장 메소드 예제 - 2 개의 List 비교하기</title>
      <link>https://nochoco-lee.tistory.com/711</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4813-ilistt-%EC%97%90-%EB%8C%80%ED%95%9C-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C-%EC%98%88%EC%A0%9C---2-%EA%B0%9C%EC%9D%98-list-%EB%B9%84%EA%B5%90%ED%95%98%EA%B8%B0&quot;&gt;Section 48.13: IList&amp;lt;T&amp;gt; 에 대한 확장 메소드 예제 - 2 개의 List 비교하기&lt;/h3&gt;
&lt;p&gt;아래의 확장 메소드를 이용하면 동일한 타입을 갖는 두개의 &lt;code&gt;IList&amp;lt; T &amp;gt;&lt;/code&gt; 에 대해 내용물 기반의 비교를 수행할 수 있다.&lt;/p&gt;
&lt;p&gt;기본적으로는 list 내의 각 요소들은 그 순서와 요소 자체를 기반으로 비교가 이루어지지만, &lt;code&gt;isOrdered&lt;/code&gt; 파라미터에 &lt;code&gt;false&lt;/code&gt; 를 넘기면 순서와 상관없이 요소들 자체만으로 비교가 이루어질 것이다.&lt;/p&gt;
&lt;p&gt;이 메소드가 정상 동작하려면, 제네릭 타입 &lt;code&gt;T&lt;/code&gt; 가 &lt;code&gt;Equals&lt;/code&gt; 와 &lt;code&gt;GetHashCode&lt;/code&gt; 메소드를 재정의 (override) 하고 있어야 한다.&lt;/p&gt;
&lt;p&gt;사용 예제:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;List &amp;lt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &amp;gt; list1 = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List &amp;lt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &amp;gt; {
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a1&quot;&lt;/span&gt;,
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a2&quot;&lt;/span&gt;,
  &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;,
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a3&quot;&lt;/span&gt;
};
List &amp;lt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &amp;gt; list2 = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List &amp;lt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &amp;gt; {
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a1&quot;&lt;/span&gt;,
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a2&quot;&lt;/span&gt;,
  &lt;span class=&quot;hljs-string&quot;&gt;&quot;a3&quot;&lt;/span&gt;,
  &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;
};
list1.Compare(list2); &lt;span class=&quot;hljs-comment&quot;&gt;// 이 결과는 false 가 될 것이다&lt;/span&gt;
list1.Compare(list2, &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;); &lt;span class=&quot;hljs-comment&quot;&gt;// 이 결과는 true 가 될 것이다. 두 리스트는 순서를 배제할 경우 동일하다 &lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;메소드 선언:&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; Compare &amp;lt; T &amp;gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; IList &amp;lt; T &amp;gt; list1, IList &amp;lt; T &amp;gt; list2, &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; isOrdered = &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;) {
  &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (list1 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; list2 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (list1 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; || list2 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; || list1.Count != list2.Count)
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (isOrdered) {
    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; list2.Count; i++) {
      &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; l1 = list1[i];
      &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; l2 = list2[i];
      &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (
        (l1 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; l2 != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) ||
        (l1 != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; l2 == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) ||
        (!l1.Equals(l2))) {

        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;;
      }
    }
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;;
  } &lt;span class=&quot;hljs-keyword&quot;&gt;else&lt;/span&gt; {
    List &amp;lt; T &amp;gt; list2Copy = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; List &amp;lt; T &amp;gt; (list2);
    &lt;span class=&quot;hljs-comment&quot;&gt;// Dictionary 를 이용해 O(n^2) 복잡도로 계산하지 않고도 구현할 수 있을것이다&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; list1.Count; i++) {
      &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (!list2Copy.Remove(list1[i]))
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;;
    }
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;;
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/711</guid>
      <comments>https://nochoco-lee.tistory.com/711#entry711comment</comments>
      <pubDate>Thu, 1 Dec 2022 22:56:17 +0900</pubDate>
    </item>
    <item>
      <title>48.12: 인터페이스와 확장 메소드를 활용한 DRY 원칙 기반의 코드 및 mix-in 과 유사한 기능 제공하기</title>
      <link>https://nochoco-lee.tistory.com/708</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4812-%EC%9D%B8%ED%84%B0%ED%8E%98%EC%9D%B4%EC%8A%A4%EC%99%80-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C%EB%A5%BC-%ED%99%9C%EC%9A%A9%ED%95%9C-dry-%EC%9B%90%EC%B9%99-%EA%B8%B0%EB%B0%98%EC%9D%98-%EC%BD%94%EB%93%9C-%EB%B0%8F-mix-in-%EA%B3%BC-%EC%9C%A0%EC%82%AC%ED%95%9C-%EA%B8%B0%EB%8A%A5-%EC%A0%9C%EA%B3%B5%ED%95%98%EA%B8%B0&quot;&gt;Section 48.12: 인터페이스와 확장 메소드를 활용한 DRY 원칙 기반의 코드 및 mix-in 과 유사한 기능 제공하기&lt;/h3&gt;
&lt;p&gt;확장 메소드를 이용하면, 인터페이스 자체에는 반드시 필요한 핵심 기능만을 포함시키고, 편의를 위한 메소드나 오버로드된 메소드는 확장 메소드를 별도로 선언함으로써 인터페이스를 간결하게 정의할 수 있다.&lt;/p&gt;
&lt;p&gt;더 적은 수의 메소드를 갖는 인터페이스는 새로운 클래스에서 더욱 쉽게 구현 (implement) 할 수 있다. 오버로드된 메소드들을 인터페이스에 직접 포함하기보다는 확장 메소드로 별도 유지함을 통해, 모든 인터페이스 구현물 (implementation) 들에 표준 문안 (boilerplate) 코드를 복사해 넣을 필요를 없앨 수 있어 사용자의 코드가 &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;DRY&lt;/a&gt; 원칙을 따를 수 있도록 한다. 이는 실제적으로 C# 에서 지원을 하지 않는 &lt;a href=&quot;https://www.patterns.dev/posts/mixin-pattern/&quot;&gt;mix-in 패턴&lt;/a&gt; 과 유사하다.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;System.Linq.Enumerable&lt;/code&gt; 내에 존재하는 &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; 에 대한 확장 메소드들이 이에 대한 훌륭한 예제이다. &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; 를 구현 (implement) 하는 클래스들은 오직 두가지 메소드를 구현하기만 하면 된다: generic 과 non-generic 버전의 &lt;code&gt;GetEnumerator()&lt;/code&gt; 가 바로 그것이다. 하지만 &lt;code&gt;System.Linq.Enumerable&lt;/code&gt; 에는 &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; 을 간결하고 명료하게 사용할 수 있도록 해주는 수많은 유용한 확장 메소드들이 제공된다.&lt;/p&gt;
&lt;p&gt;아래 예제에서는 오버로드 (overload) 된 편의를 위한 확장메소드들이 제공되는 매우 간단한 인터페이스를 보여주고 있다.&lt;/p&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ITimeFormatter&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Format&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;TimeSpan span&lt;/span&gt;)&lt;/span&gt;;
}
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;TimeFormatter&lt;/span&gt; {
  &lt;span class=&quot;hljs-comment&quot;&gt;// ITimeFormatter 를 구현하는 클래스들 모두에 대해 제공되는 오버로드된 메소드.&lt;/span&gt;
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Format&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; ITimeFormatter formatter,
    &lt;span class=&quot;hljs-keyword&quot;&gt;int&lt;/span&gt; millisecondsSpan&lt;/span&gt;)&lt;/span&gt; =&amp;gt; formatter.Format(TimeSpan.FromMilliseconds(millisecondsSpan));
}
&lt;span class=&quot;hljs-comment&quot;&gt;// 해당 인터페이스를 구현자고자 할 때는 하나의 메소드만 제공하면 되므로&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot;&gt;// 추가적인 구현물 (implementation) 을 작성하기가 매우 용이하다.&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SecondsTimeFormatter&lt;/span&gt;: &lt;span class=&quot;hljs-title&quot;&gt;ITimeFormatter&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Format&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;TimeSpan span&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; $ &lt;span class=&quot;hljs-string&quot;&gt;&quot;{(int)span.TotalSeconds}s&quot;&lt;/span&gt;;
  }
}
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt;[] args&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; formatter = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; SecondsTimeFormatter();
    &lt;span class=&quot;hljs-comment&quot;&gt;// 호출자는 두가지의 오버로드된 메소드를 사용할 수 있다&lt;/span&gt;
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;4500ms is rougly &lt;span class=&quot;hljs-subst&quot;&gt;{formatter.Format(&lt;span class=&quot;hljs-number&quot;&gt;4500&lt;/span&gt;)}&lt;/span&gt;&quot;&lt;/span&gt;);
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; span = TimeSpan.FromSeconds(&lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;);
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;&lt;span class=&quot;hljs-subst&quot;&gt;{span}&lt;/span&gt; is formatted as &lt;span class=&quot;hljs-subst&quot;&gt;{formatter.Format(span)}&lt;/span&gt;&quot;&lt;/span&gt;);
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/708</guid>
      <comments>https://nochoco-lee.tistory.com/708#entry708comment</comments>
      <pubDate>Fri, 21 Oct 2022 23:03:20 +0900</pubDate>
    </item>
    <item>
      <title>48.11: 동적 (dynamic) 코드에서의 확장 메소드 미지원</title>
      <link>https://nochoco-lee.tistory.com/707</link>
      <description>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html;charset=UTF-8&quot;&gt;

&lt;style&gt;
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: &quot;&quot;;
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table &gt; thead &gt; tr &gt; th {
	text-align: left;
	border-bottom: 1px solid;
}

table &gt; thead &gt; tr &gt; th,
table &gt; thead &gt; tr &gt; td,
table &gt; tbody &gt; tr &gt; th,
table &gt; tbody &gt; tr &gt; td {
	padding: 5px 10px;
}

table &gt; tbody &gt; tr + tr &gt; td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code &gt; div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table &gt; thead &gt; tr &gt; th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table &gt; thead &gt; tr &gt; th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table &gt; tbody &gt; tr + tr &gt; td {
	border-color: rgba(255, 255, 255, 0.18);
}

&lt;/style&gt;

&lt;style&gt;
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
&lt;/style&gt;

&lt;style&gt;
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, &quot;Ubuntu&quot;, &quot;Droid Sans&quot;, sans-serif, &quot;Meiryo&quot;;
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) &gt; code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use &lt;div class=&quot;page&quot;/&gt; to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

&lt;/style&gt;

&lt;script src=&quot;https://unpkg.com/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  &lt;/script&gt;
&lt;h3 id=&quot;section-4811-%EB%8F%99%EC%A0%81-dynamic-%EC%BD%94%EB%93%9C%EC%97%90%EC%84%9C%EC%9D%98-%ED%99%95%EC%9E%A5-%EB%A9%94%EC%86%8C%EB%93%9C-%EB%AF%B8%EC%A7%80%EC%9B%90&quot;&gt;Section 48.11: 동적 (dynamic) 코드에서의 확장 메소드 미지원&lt;/h3&gt;
&lt;pre class=&quot;hljs&quot;&gt;&lt;code&gt;&lt;div&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;dynamic&lt;/span&gt; dynamicObject = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; ExpandoObject();
    &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; awesomeString = &lt;span class=&quot;hljs-string&quot;&gt;&quot;Awesome&quot;&lt;/span&gt;;
    &lt;span class=&quot;hljs-comment&quot;&gt;// True 를 출력한다&lt;/span&gt;
    Console.WriteLine(awesomeString.IsThisAwesome());
    dynamicObject.StringValue = awesomeString;
    &lt;span class=&quot;hljs-comment&quot;&gt;// True 를 출력한다&lt;/span&gt;
    Console.WriteLine(StringExtensions.IsThisAwesome(dynamicObject.StringValue));

    &lt;span class=&quot;hljs-comment&quot;&gt;// 컴파일 시점의 에러나 경고가 출력되진 않지만, 실행 시 RuntimeBinderException 이 발생된다&lt;/span&gt;
    Console.WriteLine(dynamicObject.StringValue.IsThisAwesome());
  }
}
&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;StringExtensions&lt;/span&gt; {
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;IsThisAwesome&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;value&lt;/span&gt;.Equals(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Awesome&quot;&lt;/span&gt;);
  }
}
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;[동적 코드에서의 확장 메소드 호출] 이 동작하지 않는 이유는, 일반적인 비-동적 (non-dynamic) 코드에서는 확장 메소드 호출 시 컴파일러가 알 수 있는 모든 클래스들에 대해 일치하는 확장 메소드가 있는 정적 클래스를 찾는 전체 검색을 수행하기 때문이다. 이러한 검색은 namespace 중첩 탐색 및 각 namespace 내에 존재하는 &lt;code&gt;using&lt;/code&gt; 지시어에 기반한 탐색을 순서대로 수행하는 방식으로 진행된다.&lt;/p&gt;
&lt;p&gt;이것이 의미하는 바는, 동적 확장 메소드 호출을 정확하게 해석하기 위해서  &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Dynamic_Language_Runtime&quot;&gt;DLR&lt;/a&gt; 이 실행 시점에 원래의 소스코드를 기반으로 한 모든 namespace 중첩 및 &lt;code&gt;using&lt;/code&gt; 지시어 관련 정보를 알 수 있어야 한다는 의미이다. 현재 그러한 모든 정보를 손쉽게 각 호출 지점에 저장할 수 있는 체계가 마련되어 있지 않으며, 그러한 체계를 구현하기 위한 고려가 있긴 하였으나, 이는 과도한 비용과 일정상의 무리함에 비해 얻는 이득이 크지 않다고 판단되었다.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/5311465/extension-method-and-dynamic-object/5313149#5313149&quot;&gt;출처&lt;/a&gt;&lt;/p&gt;
&lt;h5 id=&quot;%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%8A%94-c-notes-for-professionals-%EB%9D%BC%EC%9D%B4%EC%84%BC%EC%8A%A4cc-by-sa-%EB%A5%BC-%ED%95%9C%EA%B8%80%EB%A1%9C-%EB%B2%88%EC%97%AD%ED%95%9C-%EB%AC%B8%EC%84%9C%EC%9E%85%EB%8B%88%EB%8B%A4-%EB%B2%88%EC%97%AD%EC%83%81-%EC%98%A4%EB%A5%98%EA%B0%80-%EC%9E%88%EC%9D%84-%EC%88%98-%EC%9E%88%EC%9C%BC%EB%AF%80%EB%A1%9C-%EC%A0%95%ED%99%95%ED%95%9C-%EB%82%B4%EC%9A%A9%EC%9D%80-%EC%9B%90%EB%B3%B8-%EB%AC%B8%EC%84%9C%EB%A5%BC-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%84%B8%EC%9A%94&quot;&gt;본 문서는 &lt;a href=&quot;https://books.goalkicker.com/CSharpBook&quot;&gt;C# Notes for Professionals&lt;/a&gt; &lt;a href=&quot;http://www.cckorea.org/xe/ccl&quot;&gt;(라이센스:CC-BY-SA)&lt;/a&gt; 를 한글로 번역한 문서입니다. 번역상 오류가 있을 수 있으므로 정확한 내용은 원본 문서를 참고하세요.&lt;/h5&gt;
&lt;p&gt;[출처] https://books.goalkicker.com/CSharpBook/&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</description>
      <category>번역/C# Notes for Professionals</category>
      <author>노초코</author>
      <guid isPermaLink="true">https://nochoco-lee.tistory.com/707</guid>
      <comments>https://nochoco-lee.tistory.com/707#entry707comment</comments>
      <pubDate>Fri, 21 Oct 2022 23:01:26 +0900</pubDate>
    </item>
  </channel>
</rss>