<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kentem_dev_mukaida</author_name>
  <author_url>https://blog.hatena.ne.jp/kentem_dev_mukaida/</author_url>
  <blog_title>KENTEM TechBlog</blog_title>
  <blog_url>https://tech.kentem.jp/</blog_url>
  <categories>
    <anon>バックエンド</anon>
  </categories>
  <description>ASP.NET Core の依存関係の挿入って知っていますか？依存関係の挿入を使う事で効率的なリソース管理を行ったり、テストコードが書きやすかったりします。今回は ASP.NET Core を使ったクラス管理について MVC パターンでまとめたいと思います。 シンプルに登録して使う サービスの有効期間を使い分ける 登録メソッド AddSingleton AddScoped AddTransient インターフェイスを使ってダミーに差し替える 運用コードの変更 テストコードの実装 まとめ おわりに シンプルに登録して使う クラスを依存関係に登録します。この記事では登録するクラスの事をサービスクラ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.kentem.jp%2Fentry%2F2025%2F05%2F16%2F090000&quot; title=&quot;ASP.NET Core の依存関係の挿入を使おう - KENTEM TechBlog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/k/kentem_dev_mukaida/20250512/20250512194720.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-05-16 09:00:00</published>
  <title>ASP.NET Core の依存関係の挿入を使おう</title>
  <type>rich</type>
  <url>https://tech.kentem.jp/entry/2025/05/16/090000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
