<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/codemaze/best-of/2024/10" -->

---
title: Best Code Maze posts — October 2024 | daily.dev
description: The most upvoted Code Maze posts from October 2024, curated by the daily.dev community.
canonical: https://daily.dev/sources/codemaze/best-of/2024/10
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/codemaze/best-of/2024/10
og:type: website
og:site_name: daily.dev
og:title: Best Code Maze posts — October 2024 | daily.dev
og:description: The most upvoted Code Maze posts from October 2024, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Code Maze — October 2024

1. 1  
[](https://daily.dev/posts/how-to-get-an-instance-of-iserviceprovider-in-net-rqkuzdu7g "How to Get an Instance of IServiceProvider in .NET")  
Article  
![Avatar of codemaze](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5004eb44be854b11bc10517031b0ad88)Code Maze · 2y  
How to Get an Instance of IServiceProvider in .NET  
In modern .NET applications, understanding how to obtain and use an instance of IServiceProvider is crucial for effective dependency injection, which promotes loose coupling and enhances maintainability. This post outlines various methods to get an instance of IServiceProvider, including during application startup, within service classes, controllers, and unit tests. It also discusses best practices and common pitfalls, emphasizing the importance of proper service lifecycle management and the benefits of constructor injection over direct service resolution.  
24

[See all Code Maze archives](/sources/codemaze/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/codemaze/best-of/2024/10#page","url":"https://daily.dev/sources/codemaze/best-of/2024/10","name":"Best Code Maze Posts — October 2024","description":"The most upvoted Code Maze posts from October 2024, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/codemaze/best-of/2024/10#items","numberOfItems":1,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/how-to-get-an-instance-of-iserviceprovider-in-net-rqkuzdu7g","name":"How to Get an Instance of IServiceProvider in .NET"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Code Maze","item":"https://daily.dev/sources/codemaze"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/codemaze/best-of"},{"@type":"ListItem","position":5,"name":"October 2024"}]}]}
```

