Ninject Set Default to Request Scope When Using Convention Based Binding

In many cases when using ninject on an ASP.NET site it makes sense to configure ninject to use Request Scope for its default object scope. (more info:

When searching for how to set Request Scope as the default object scope, I could not find any code snippets to accomplish this.

I found many snippets that would set scope for an individual binding:


But no examples of how to set request scope as the default for all bindings.

Here is a code snippet of how I accomplished this:

            .Bind(i => i.FromThisAssembly()
            .Configure(x => x.InRequestScope()));

Hope this helps,


Popular posts from this blog

Search iPhone Text Messages with SQLite SQL Query

Use Azure Functions to Execute a SQL Azure Stored Procedure on a Timer

How to Turn Off Microsoft Arc Touch Mouse Scroll Sound Vibration