Conditional dependency injection binding only when property not null
It is a desktop application which is obliged to impersonate the current user when accessing the underlying data source. How can I tell Ninject not to bind the dependency until the property of a parent object is not null? Application forces user authentication upon startup Once authenticated, a reference to the current user credentials is kept within the IMembershipService Accessing the underlying datasource obliges to have a user authenticated so that the commection string states the credentials to impersonate I am actually using NHibernate, and I need to dynamically create the connection