toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

218
active users

#dependencyinjection

0 posts0 participants0 posts today
Garvin Hicking<p>Seit einiger Zeit darf ich die hervorragende <a href="https://phpc.social/tags/Fortbildungsflatrate" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fortbildungsflatrate</span></a> der <span class="h-card" translate="no"><a href="https://phpc.social/@thephpcc" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>thephpcc</span></a></span> nutzen. Themen rund um<br>PHP werden sehr in der Tiefe und didaktisch exzellent vermittelt. Ich habe dadurch in einem Jahr mehr Wissen angeeignet als in 5 zuvor.</p><p>Zum Termin (<a href="https://phpc.social/tags/DependencyInjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DependencyInjection</span></a>) morgen könnt ihr reinschnuppern wenn ihr euch per Mail meldet: <a href="https://thephpcc.academy/de/clean-code-dependency-inversion" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">thephpcc.academy/de/clean-code</span><span class="invisible">-dependency-inversion</span></a></p><p>Tut das!</p>
Alvin Ashcraft 🐿️<p>Announcing CommandLineExtensions, a .NET DI Compatible System.CommandLine Facade | by Peter Ritchie.</p><p><a href="https://blog.peterritchie.com/posts/announcing-commandlineextensions" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.peterritchie.com/posts/an</span><span class="invisible">nouncing-commandlineextensions</span></a></p><p><a href="https://hachyderm.io/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> <a href="https://hachyderm.io/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a> <a href="https://hachyderm.io/tags/commandline" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commandline</span></a></p>
Alvin Ashcraft<p>Announcing CommandLineExtensions, a .NET DI Compatible System.CommandLine Facade | by Peter Ritchie. <a href="https://buff.ly/YSc94qE" rel="nofollow noopener" target="_blank">buff.ly/YSc94qE</a> <a class="hashtag" href="https://bsky.app/search?q=%23dotnet" rel="nofollow noopener" target="_blank">#dotnet</a> <a class="hashtag" href="https://bsky.app/search?q=%23dependencyinjection" rel="nofollow noopener" target="_blank">#dependencyinjection</a> <a class="hashtag" href="https://bsky.app/search?q=%23commandline" rel="nofollow noopener" target="_blank">#commandline</a><br><br><a href="https://buff.ly/YSc94qE" rel="nofollow noopener" target="_blank">Peter Ritchie's Blog - Announc...</a></p>
Damir Arh<p>Microsoft's HTTP resilience package simplifies using Polly with HTTP client</p><p><a href="https://www.damirscorner.com/blog/posts/20250328-HttpResilienceWrapperForPolly.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">damirscorner.com/blog/posts/20</span><span class="invisible">250328-HttpResilienceWrapperForPolly.html</span></a></p><p><a href="https://mas.to/tags/polly" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>polly</span></a> <a href="https://mas.to/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a> <a href="https://mas.to/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a></p>
The Breakpoint Show<p>Dependency Injection in .NET—are you using it effectively? In the latest Breakpoint Show episode, we break down DI fundamentals, explore lifetime strategies (Singleton, Scoped, Transient), and share best practices to avoid common pitfalls.</p><p>Tune in and level up your .NET skills!</p><p><a href="https://www.breakpoint.show/podcast/episode-036-episode-of-a-lifetime/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">breakpoint.show/podcast/episod</span><span class="invisible">e-036-episode-of-a-lifetime/</span></a></p><p><a href="https://mastodon.social/tags/DotNET" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DotNET</span></a> <a href="https://mastodon.social/tags/DependencyInjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DependencyInjection</span></a> <a href="https://mastodon.social/tags/CSharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CSharp</span></a></p>
Helsinki Python<p>🇫🇮🐍 Welcome to our next meetup on Wednesday 19th March 2025 at Taiste:</p><p>Talks:</p><p>✒️ <span class="h-card" translate="no"><a href="https://mastodon.world/@hamatti" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>hamatti</span></a></span> - Why developers should write blog posts</p><p>💉 Sakari Cajanus - Dependency injection in Python (or why Python is not Java)</p><p>🦀 Mislav Novakovic - Refactoring to Rust</p><p>And the famous HelPy quiz!</p><p><a href="https://www.meetup.com/helpy-meetups/events/306522919/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">meetup.com/helpy-meetups/event</span><span class="invisible">s/306522919/</span></a></p><p>Please also drop us a line if you’d like to give a talk in April or beyond ⭐</p><p><a href="https://fosstodon.org/tags/HelPy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HelPy</span></a> <a href="https://fosstodon.org/tags/Helsinki" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Helsinki</span></a> <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://fosstodon.org/tags/meetup" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>meetup</span></a> <a href="https://fosstodon.org/tags/writing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>writing</span></a> <a href="https://fosstodon.org/tags/blogging" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>blogging</span></a> <a href="https://fosstodon.org/tags/DependencyInjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DependencyInjection</span></a> <a href="https://fosstodon.org/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a></p>
Alvin Ashcraft 🐿️<p>Dependency Injection Basics in .NET MAUI | On .NET with James Montemagno.</p><p><a href="https://hachyderm.io/tags/dotnetmaui" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnetmaui</span></a> <a href="https://hachyderm.io/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> <a href="https://hachyderm.io/tags/csharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csharp</span></a> <a href="https://hachyderm.io/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a> <a href="https://hachyderm.io/tags/mobiledev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mobiledev</span></a> <a href="https://hachyderm.io/tags/windowsdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>windowsdev</span></a> <br><a href="https://www.youtube.com/watch?v=9X1TwT9wWCE&amp;ab_channel=dotnet" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=9X1TwT9wWC</span><span class="invisible">E&amp;ab_channel=dotnet</span></a></p>
Vyechi<p><strong>Generic Repository Pattern in&nbsp;C#</strong></p><p class="">Have you ever dreaded writing the same boilerplate repository code repeatedly? You’re not alone; I will share my implementation of the Code First Generic Repository Pattern in C#. I will only include some of the code because it will make the post incredibly long. At the end of the post, I will share a Goal donation to post a Git download link so you can take it for a spin. As a bonus, the repository uses <a href="https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/workflows/new-database" rel="nofollow noopener" target="_blank">Code First</a> and Unit of Work.</p><p><strong>Generic Repository Pattern in C#</strong></p><p>Let’s begin with the Entity interface. The <strong>IEntity </strong>interface is a typical pattern used in software development to define a contract for entities, typically in the context of data access and persistence. It usually includes a property for the entity’s unique identifier. The Generic Type: The <strong>IEntity </strong>interface uses a generic type parameter <strong>TKey</strong> to allow flexibility in the type of the identifier (e.g., <em>int, Guid, string</em>). The <strong>ID</strong> property will identify each entity uniquely. Feel free to read more about the implementation at <a href="https://codingblast.com/entity-framework-core-generic-repository" rel="nofollow noopener" target="_blank">the entity framework core generic repository</a> and <a href="https://learn.microsoft.com/en-us/windows/win32/api/structuredquery/nn-structuredquery-ientity" rel="nofollow noopener" target="_blank">Structured Query IEntity</a>.</p> <pre>public interface IEntity&lt;TKey&gt;{ TKey Id { get; set; }}</pre> <p>You might find the following definition of the generic repository pattern on the interwebs.</p><blockquote><p>The Generic Repository pattern in C# is a design pattern that abstracts the application’s data layer, making it easier to manage data access logic across different data sources. It aims to reduce redundancy by implementing typical data operations in a single, generic repository rather than having separate repositories for each entity type.</p></blockquote> <pre>public interface IGenericRepository&lt;TEntity, TKey&gt; where TEntity : class, IEntity&lt;TKey&gt;{ void Delete(TEntity entityToDelete); TEntity? GetFirstOrDefault(Expression&lt;Func&lt;TEntity, bool&gt;&gt; predicate); void Update(TEntity entityToUpdate); void Save(); void Dispose();}</pre> <p>The interface header has two generic types. <strong>TEntity </strong>is the domain class, and the <strong>TKey </strong>is<strong> </strong>the ID type, int, or string. Note that <strong>IEntity </strong>abstracts away the type <strong>TKey</strong>. It looks complex for the moment, but you will see benefits later.</p><p>Moving away from the Generic Repository, let’s focus on the pattern of the Unit of Work. According to Copilot:</p><blockquote><p>The&nbsp;<strong>Unit of Work</strong>&nbsp;is a design pattern used in software development to manage and coordinate changes to a database. It ensures that all operations within a single business transaction are treated as a single unit, which means they either all succeed, or all fail together. This helps maintain data integrity and consistency.</p><p><a href="https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions/getting-started-with-ef-5-using-mvc-4/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application" rel="nofollow noopener" target="_blank">Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10) | Microsoft Learn</a></p><p><a href="https://code-maze.com/csharp-unit-of-work-pattern/" rel="nofollow noopener" target="_blank">https://code-maze.com/csharp-unit-of-work-pattern/</a></p></blockquote> <pre>public interface IUnitOfWork : IDisposable{ IGenericRepository&lt;TEntity, TKey&gt; Repository&lt;TEntity, TKey&gt;() where TEntity : class, IEntity&lt;TKey&gt;; void Save(); Task&lt;int&gt; SaveAsync();}</pre> <p>The Unit of Work will allow us later to inject it as a service for any repository. If you inspect the interface closely, you will notice it has three fields. The most vital of the three is the <strong>Repository</strong>. The method returns a domain of type repository and key. You can specify the type when using it.</p><p>Moving on to the Code First portion, we must tell Entity Framework how to build our database. To do so, we can create a “BloggingContext”.</p> <pre>public class BloggingContext: DbContext{ // Use design time factory public BloggingContext(DbContextOptions&lt;BloggingContext&gt; dbContextOptions) : base(dbContextOptions) { } public DbSet&lt;Blog&gt; Blogs { get; set; } public DbSet&lt;Post&gt; Posts { get; set; }}</pre> <p>If you inspect the code closely, you will notice that we inherited from DbContext, which allows us to manipulate the database. The DbContext will also enable us to use DbSets and CRUD methods. You can read more about <a href="https://learn.microsoft.com/en-us/dotnet/api/system.data.entity.dbcontext?view=entity-framework-6.2.0" rel="nofollow noopener" target="_blank">DbContext Class on the Microsoft website</a>. </p><p>Before using your Database Context with Code, you must set up migrations. Migrations allow you to evolve your database as you code and change the schema. I recommend you read up on <a href="https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=vs#evolving-your-model" rel="nofollow noopener" target="_blank">Migrations managing schemas</a> because it has excellent examples to help you start quickly.</p><p>At the high level, in Visual Studio, open up the Tools menu, then the NuGet Package Manager menu, followed by the Console. In the Console, you must install the following package.</p><blockquote><p>Install-Package Microsoft.EntityFrameworkCore.Tools</p></blockquote><p>The Microsoft.EntityFrameworkCore.Tools will allow you to make the following commands.</p><blockquote><p>Add-Migration InitialCreate</p><p>Update-Database</p></blockquote><p>Meanwhile, you might want to consider making a DesignTimeDbContextFactory because it aids in setting up the connection string for the database.</p> <pre>public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory&lt;BloggingContext&gt;{ public BloggingContext CreateDbContext(string[] args) { // Build configuration IConfigurationRoot configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.Development.json") .Build(); // Get connection string var connectionString = configuration.GetConnectionString("DefaultConnection"); var optionsBuilder = new DbContextOptionsBuilder&lt;BloggingContext&gt;(); optionsBuilder.UseSqlServer(connectionString); return new BloggingContext(optionsBuilder.Options); }}</pre> <p>I’m considering publishing the fully working example on Git with the following components.</p><ul><li>Services</li><li>Domain</li><li>Interfaces</li><li>Repository</li><li>Console App with basic CRUD operations</li><li>Dependency Injection</li></ul><p><strong>Current Donation Amount</strong></p><p class="">$2.41 – PayPal fees 🤑</p><p>Note that the donation amount is being updated manually on my end. I have asked WordPress; see the image for details. I will list your name and last name initials. If you like the website backlink, donate $10 or more, and let me know in the comments your web address.</p> <p>Donate to Goal of $666 to unlock Code First Generic Repository Pattern 🚀✨</p> <p>Upon reaching the $666 Goal, I will share the code.</p> <p>$3.00</p> <p><a class="" href="http://vyechi.com/?p=237713" rel="nofollow noopener" target="_blank">Click here to purchase.</a></p> <p><strong>Donators List</strong></p><ul><li>Nicholas S 8.20.2024</li></ul><p></p><p><span></span></p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/codeefficiency/" target="_blank">#CodeEfficiency</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/codefirst/" target="_blank">#CodeFirst</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/crudoperations/" target="_blank">#CRUDOperations</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/csharp/" target="_blank">#CSharp</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/databasemanagement/" target="_blank">#DatabaseManagement</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/dbcontext/" target="_blank">#DbContext</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/dependencyinjection/" target="_blank">#DependencyInjection</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/designpatterns/" target="_blank">#DesignPatterns</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/entityframework/" target="_blank">#EntityFramework</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/genericrepository/" target="_blank">#GenericRepository</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/migrations/" target="_blank">#Migrations</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/repositorypattern/" target="_blank">#RepositoryPattern</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/softwaredevelopment/" target="_blank">#SoftwareDevelopment</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://vyechi.com/tag/unitofwork/" target="_blank">#UnitofWork</a></p>
Miha Markič<p>Not being able to make <a href="https://mastodon.social/tags/csharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csharp</span></a> primary constuctor fields readonly, is a big bummer when it comes to <a href="https://mastodon.social/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a></p>
Ænðr E. Feldstraw<p>Reflection considered harmful<br> <br>In the <a href="https://mastodon.social/tags/java" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>java</span></a> and <a href="https://mastodon.social/tags/csharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csharp</span></a> OOP programming languages, <a href="https://mastodon.social/tags/reflection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>reflection</span></a> is used to not only review an object’s private fields and methods, but also to access and change them.<br> <br>This is used for instance by large <a href="https://mastodon.social/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a> libraries and frameworks, by preprocessors, and of course by the standard library itself. <br> <br>It is dangerous because it can break a class’ definition of what should be private and inaccessible. <br> <br>Every programmer should know.</p>
Alvin Ashcraft 🐿️<p>Adding Host to WPF for Dependency Injection.</p><p><a href="https://hachyderm.io/tags/windowsdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>windowsdev</span></a> <a href="https://hachyderm.io/tags/csharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csharp</span></a> <a href="https://hachyderm.io/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> <a href="https://hachyderm.io/tags/wpf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wpf</span></a> <a href="https://hachyderm.io/tags/xaml" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xaml</span></a> <a href="https://hachyderm.io/tags/di" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>di</span></a> <a href="https://hachyderm.io/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a><br><a href="https://formatexception.com/2024/02/adding-host-to-wpf-for-dependency-injection/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">formatexception.com/2024/02/ad</span><span class="invisible">ding-host-to-wpf-for-dependency-injection/</span></a></p>
Ahmed Tarek<p>⛔ When Not To Use DI, IoC, and IoC Containers in .NET C#<br>🚫</p><p>➡ Dependency Injection (DI), Inversion of Control (IoC), and IoC Containers are our friends, but like everything in life, if you abuse them, you would get what you don’t ever wish for.</p><p>➡ After reading this article, you would know when DIs are not the right solution and the better design to use.</p><p>📖 <a href="https://developmentsimplyput.com/post/when-not-to-use-di-ioc-and-ioc-containers-in-net-c" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">developmentsimplyput.com/post/</span><span class="invisible">when-not-to-use-di-ioc-and-ioc-containers-in-net-c</span></a></p><p>📭 <a href="https://developmentsimplyput.com/subscribe" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">developmentsimplyput.com/subsc</span><span class="invisible">ribe</span></a></p><p><a href="https://dotnet.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> <a href="https://dotnet.social/tags/softwaredesign" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>softwaredesign</span></a> <a href="https://dotnet.social/tags/softwarearchitecture" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>softwarearchitecture</span></a> <a href="https://dotnet.social/tags/di" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>di</span></a> <a href="https://dotnet.social/tags/ioc" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ioc</span></a> <a href="https://dotnet.social/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a></p>
P-Y<p>Let's demystify how Dependency Injection libraries work!</p><p>In this article, we'll implement Google Guice, Dagger 1 and Dagger 2... and I'll even reveal where the dreaded Thermosiphon example comes from.</p><p><a href="https://blog.p-y.wtf/diy-your-own-dependency-injection-library" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.p-y.wtf/diy-your-own-depe</span><span class="invisible">ndency-injection-library</span></a></p><p><a href="https://androiddev.social/tags/AndroidDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AndroidDev</span></a> <a href="https://androiddev.social/tags/DependencyInjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DependencyInjection</span></a> <a href="https://androiddev.social/tags/Kotlin" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Kotlin</span></a> <a href="https://androiddev.social/tags/Java" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Java</span></a></p>
Niko Föhr<p>Good point about dependency injection in a talk "Stop Mocking, Start Testing" by Augie Fackler, Nathaniel Manista (PyCon US 2012)</p><p>Felt a second of guilty as I had just an hour ago written code to do *just that*; </p><p>someobj = someobj or SomeClass()</p><p>And tapped myself on the shoulder for "using dependency injection and making testing easy".</p><p><a href="https://youtu.be/Xu5EhKVZdV8?si=ft-K8WA8lBA65eE9&amp;t=1229" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">youtu.be/Xu5EhKVZdV8?si=ft-K8W</span><span class="invisible">A8lBA65eE9&amp;t=1229</span></a></p><p><a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://mastodon.social/tags/developers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>developers</span></a> <a href="https://mastodon.social/tags/dependencyinjection" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependencyinjection</span></a></p>

#AspNetCore #dotnet #DependencyInjection
I know how DI in general works, my libraries have various `AddFooService` extensions on `IServiceCollection` etc..

What I want to know is, if there's a pattern I can follow, if my `FooService` needs several peer dependencies (e.g. some `IMailingService`, `IStorageService`, `IIdentityService`) how can I ensure, that those are registered? I see some things like `AddControllers` which returns an `IMvcBuilder` so you can configure things. 1/2

Why aren't you using dependency injection in your #dotnetmaui app yet?

In my latest blog post, I show you how to leverage the powerful, built-in dependency injection capabilities of .NET MAUI, including common pitfalls that you should know about when using dependency injection with .NET MAUI:

ewerspej.hashnode.dev/are-you-

I hope this is helpful. Come visit my blog and follow me so you don't miss out on future posts and updates.

Julian's BlogAre you using Dependency Injection in your .NET MAUI app yet?By Julian Ewers-Peters