<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C# on -小佑-（&lt;ゝω·）キラbosh☆</title><link>https://yuchia-wei.github.io/categories/c%23/</link><description>Recent content in C# on -小佑-（&lt;ゝω·）キラbosh☆</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Sun, 06 Feb 2022 20:10:27 +0800</lastBuildDate><atom:link href="https://yuchia-wei.github.io/categories/c%23/index.xml" rel="self" type="application/rss+xml"/><item><title>EF Core 自訂關聯</title><link>https://yuchia-wei.github.io/2022/02/ef-core-%E8%87%AA%E8%A8%82%E9%97%9C%E8%81%AF/</link><pubDate>Sun, 06 Feb 2022 20:10:27 +0800</pubDate><guid>https://yuchia-wei.github.io/2022/02/ef-core-%E8%87%AA%E8%A8%82%E9%97%9C%E8%81%AF/</guid><description>&lt;p>當 Db 內的 Table 都沒有設定關聯，又希望在不調整 Db 的情況下用操作有關連 Table 的方法使用 EF Core 時，可以在 EF Core 所使用的 Entity 與 Entity Configuration 中自訂關聯性，EF Core 會自行調整 Sql 語法 (使用 Left join 或其它 join 語法) 來加入資料。&lt;/br>&lt;/p>
&lt;p>EF Power Tool 產生的 Entity / Entity Configuration 預設皆有引入 partial 關鍵字，因此，為了區別工具產生的 code 與自訂的 code，我們可以另外建立新的檔案處理自定義的部分。&lt;/br>&lt;/p>
&lt;p>本篇範例為 一對一、一對多 的設定方式。&lt;/br>&lt;/p>
&lt;div class="details admonition warning open">
 &lt;div class="details-summary admonition-title">
 &lt;span class="icon">&lt;svg class="icon"
 xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">&lt;!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->&lt;path d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/>&lt;/svg>&lt;/span>警告&lt;span class="details-icon">&lt;svg class="icon"
 xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512">&lt;!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->&lt;path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"/>&lt;/svg>&lt;/span>
 &lt;/div>
 &lt;div class="details-content">
 &lt;div class="admonition-content">TODO: 示範用程式碼待補 (2022-02-06)&lt;/div>&lt;/div>&lt;/div></description></item><item><title>Use EF-Core to Join</title><link>https://yuchia-wei.github.io/2022/02/use-ef-core-to-join/</link><pubDate>Sun, 06 Feb 2022 20:03:27 +0800</pubDate><guid>https://yuchia-wei.github.io/2022/02/use-ef-core-to-join/</guid><description>&lt;p>EF Core 中使用 Join&lt;/p></description></item></channel></rss>