---
title: "Comment by Renatas Laužadis on \"Are you using Dependency Injection in your .NET MAUI app yet?\" | Hashnode"
description: "Hi, Julian, why, when registering singleton, are you using Instance for DeviceService, but not for AudioService?"
url: "https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f/comment/65e4d83cdc15705d19ce854a"
---

[Discussion](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f)

Comment [Are you using Dependency Injection in your .NET MAUI app yet?](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f)

[Renatas Laužadis](https://hashnode.com/@devmanlab)

[Mar 3, 2024](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f/comment/65e4d83cdc15705d19ce854a)

Hi, Julian, why, when registering singleton, are you using Instance for DeviceService, but not for AudioService?

[Julian Ewers-Peters](https://hashnode.com/@ewerspej)

[Mar 28, 2024](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f/comment/65e4d83cdc15705d19ce854a#reply-66051ef99609cc27c5eb7bc4)

Hi Renatas,

sorry, I only saw your comment now. Not sure what exactly you mean. In the sample repository, the AudioService isn't implemented, yet, it doesn't use the Singleton Design (anti-) Pattern. I just want to demonstrate different ways to register and use dependencies.

What matters most is that the SOLID principles are applied wherever possible. Now, the code in the samples repository isn't perfect, it's a showcase of possibilities.

Generally, any service with a public @[Object](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f/comment/constructor) or factory method can be registered as a singleton, transient or scoped dependency. Note that the term "singleton" is somewhat overloaded here, because in the context of dependency injection, it means that always the same instance will be resolved by the DI container, it doesn't mean the Singleton Design Pattern (SDP). Classes that use the SDP can still also be registered as a singleton dependency, in which case you don't register the @[Object](https://hashnode.com/posts/are-you-using-dependency-injection-in-your-net-maui-app-yet/6482f2104778277cfdf5862f/comment/constructor) (because it's private) or a factory (because it doesn't exist), but rather the static singleton instance.

I hope this clears it up a little.

Cheers Julian
