Builder is coming empty

Asked

Viewed 38 times

2

I am making a program in Asp net web apllication, but when I try to communicate the controller with the service the constructor this null saind, the dependencies are already configured in the project.

public HomeController(){}
public readonly OficinaService _oficinaService;

public HomeController(OficinaService oficinaService)
{
    this._oficinaService = oficinaService;


}

follows the project on github https://github.com/REIFERREIRA/ProjHi

  • Just as an observation, I saw that your service has a constructor receiving the controller as parameter, and the controller receives the service as parameter in your constructor. I believe this redundancy is not correct. Also I did not see (I may not have noticed) any dependency injection configuration in the project...

1 answer

0

  • It does not work if I remove the public Homecontroller(){}, from the following error: No constructor without parameters has been set for this object. I’m a bit of a dead end I’ve tried everything.

  • @GABRIELVFA did you register DI? Which framework are you using? I couldn’t find it in your project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.