C
C#7mo ago
alperenk._

Circular Dependency

I encounter a error message. Does it try to create IproductRepository interface before Helmetservice ? I dont know. Here is the full error message;
No description
No description
5 Replies
alperenk._
alperenk._OP7mo ago
this is the full error message
Pobiega
Pobiega7mo ago
show the constructor for HelmetService
alperenk._
alperenk._OP7mo ago
public HelmetService(IProductRepository productRepository) { this.productRepository = productRepository; }
Pobiega
Pobiega7mo ago
yeah so uh You are registering HelmetService to be resolved as your IProductRepository you then also try to inject an IProductRepository into HelmetService. This is a circular reference. ie, helmetservice is requesting itself
alperenk._
alperenk._OP7mo ago
oh
Want results from more Discord servers?
Add your server