c# - Ninject Func clarification -


could please me understand statement below please:

kernel.bind<func<ikernel>>().tomethod(ctx => () => ctx.kernel) 
  1. what above code do?
  2. what func?
  3. 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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -