Bidzina Goginashvili

Bidzina Goginashvili

  • NA
  • 206
  • 26.5k

Dependency Injection

Apr 27 2019 3:12 PM
I am a little bit confused with Dependency Injection and i want to exact if i get this topic well.For instance:  We have a class called BooksService and an interface called IBooksService and this BookService Class is using this IBooksService Interface,  but they are not dependant on each other  while i do not register it in a StartupFile.cs  in .net core....and when i will register this in startupfile like that (services.AddTransient<IBookService,BookService>();) they become dependant on each other and then if i instantiate IBookService interface in controller i would be possible to use IBookServices declaration with it's implementations(which is in BookService Class)? Please correct me if i'm mistaken...and add some details if i am halfly correct.

Answers (1)