forked from MiguelMadero/ninject-dynamic
-
Notifications
You must be signed in to change notification settings - Fork 0
A DLR integration for Ninject
casualjim/ninject-dynamic
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository contains the ruby branch of Ninject. The aim is to integrate the DLR as nicely as possible in a DI container. If you're using Resharper for running unit tests you'll have to uncheck the box next to Shadow-copies being tested in the unit testing section of the resharper options. example: to_configure_ninject do |ninject| ninject.bind IServiceA, :to => ServiceA, :as => :singleton, :meta => { :type => "superservice" }, :name => "aaaaa" end The typical use case would probably look like this: to_configure_ninject do |ninject| ninject.bind IServiceA, :to => ServiceA, :as => :transient ninject.bind ISingletonService, :to => SingletonServiceImpl end All the configuration options: to_configure_ninject do |ninject| ninject.bind IServiceA, :to => ServiceA, :as => :singleton, :meta => { :type => "superservice" }, :name => "aaaaa", :parameter => { :my_param => lambda { |context| "param_value" } }, :constructor_arguments => {:const_arg => 56 }, :property_values => {:property_name => 94 }, :on_activation => lambda { |obj| obj.do_some_work }, :on_deativated => lambda { |obj| obj.do_some_cleanup }, :when => { :provider => lambda { |context| "a value" }, :injected_into => ServiceB, :target_has => AnAttribute, :member_has => AnAttribute, :class_has => AnAttribute } end Happy playing :)
About
A DLR integration for Ninject
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published