Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From what I understand. </p> <p>Your goal is to use Dependency Injection with something like Ninject so that you can inject different implementations based on the Controller in a particular area being used in your application?</p> <p>If this is the case, you can setup NinjectModules that bind certain implementations of a particular service defined by your interface or abstract class through the Ninject Named attribute, which you can place on your Controller Constructors.</p> <p>For example, you might have a general Search Controller that is open to the public in an area such as</p> <blockquote> <p><a href="http://example.com/" rel="nofollow">http://example.com/</a><strong>users</strong>/home/search</p> </blockquote> <p>Using Ninject Named Attribute you could inject an implementation of a ISearchService which is consumed by that controller, which may offer a limited amount of functionality for public users to search properties on,</p> <p>however in another area of the site, such as admin or users who post their own properties on the site may get more access through the search functionality</p> <blockquote> <p><a href="http://example.com/" rel="nofollow">http://example.com/</a><strong>tenants</strong>/home/search</p> </blockquote> <p>This HomeController can have a different injected implementation of the ISearchService which is passed through its constructor.</p> <p>Just ensure to load all your NinjectModules in Global.asax</p> <p>This can be found under the <a href="https://github.com/ninject/ninject/wiki/Contextual-Binding" rel="nofollow">Ninject Contextual Bindings documentation here</a></p> <p>I'm going on very little information from what you've given me here, you may get better answers if you provide a little more context / code examples of the issue you are facing with your architectural design considerations.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload