0

I have three classes class A, class B and class C. I want to inject Class A and Class B as a dependency through constructor to Class C. I am using ScalDI dependency injection framework. Can someone tell me how I can do it?

class A {
...}
class B {
..}
class C(a:A , b:B) = {
...}
rethab
  • 7,170
  • 29
  • 46
user1733735
  • 423
  • 1
  • 6
  • 20

1 Answers1

0

There is short explanation on scaldi website: constructor injection

You have to use injected macro, or inject them in the following fashion:

bind [C] to new C(inject [A], inject [B])

Of Course binding to A and B have to be defined as well.

L.Lampart
  • 755
  • 5
  • 10