c# - Ninject Func clarification -
could please me understand statement below please:
kernel.bind<func<ikernel>>().tomethod(ctx => () => ctx.kernel)
- what above code do?
- what func?
- is trying bind , interface ikernel something...? part confuses me:
<func<ikernel>>().tomethod(ctx => () => ctx.kernel
)
i'm aware kernel.bind used bind interface concrete type not sure above there's no concrete type given.
how fits in real world scenario. why , when use function
thanks
looks ninject.
basically tells dicontainer
of ninject return function returning kernel
of current context whenever somethings asks dicontainer
func<ikernel>
.
take here.
so, func
?
from the documentation @ msdn:
encapsulates method has no parameters , returns value of type specified tresult parameter.
you should have generics , lambda expressions.
Comments
Post a Comment