So I'm trying to create a Web API using .NET 5.0 and cannot get my head around how should i inject my dependency.
In a course that I follow the instructor uses an interface for one dependency and a class for another. So to figure out the difference between these usages I tried to code the same dependency in a class and then in an interface.
This is class one;
And they work exactly the same. So what is the difference? Are there any advantages to using one over another? Which one should I use in which case? Thank you so much.