Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9249781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:17:04+00:00 2026-06-18T10:17:04+00:00

I got the IUnitOfWork interface (with its implementation which I wont show you): public

  • 0

I got the IUnitOfWork interface (with its implementation which I wont show you):

public interface IUnitOfWork : IDisposable
{
    ...
}

Note the IDisposable inheritance. Also, I got the service with the appropriate implementation:

public interface IBusinessLogicService
{
    ...
}

public sealed class BusinessLogicService : IBusinessLogicService
{
    // Dependency is auto-injected by ninject
    // because of the custom injection heuristic.
    public IUnitOfWork UnitOfWork { get; set; }

    ...
}

There we go the ninject binding:

kernel.Bind<IUnitOfWork>().To<UnitOfWork>().InRequestScope();
kernel.Bind<IBusinessLogicService>().To<BusinessLogicService>();

As you can see, ninject will automatically deactivate the IUnitOfWork instance at the end of the request and also dispose it.

Now, the question,
will the ninject also deactivate (and reactivate on the next web request) the instances (like IBusinessLogicService) that are dependent on the deactivating object?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:17:05+00:00Added an answer on June 18, 2026 at 10:17 am

    No, Ninject will deactivate an object when the scope is collected if there is a scope. Transient objects are not tracked by Ninject and are considered to be managed externally [and fresh instances are created wherever one is required].

    The deactivation point for a scope worth of objects is normally dictated by when the scoping object gets garbage collected.

    For InRequestScope the deactivation takes place deterministically at the end of a request using an ASP.NET pipeline hook.

    See also Ninject.Extensions.NamedScope for more options in this space

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got a Jsfiddle where I have a textarea which fills a table cell. But
Got a jsfiddle here where I am trying to sort out a confirmation which
Got 2 questions regarding a table which output is below: Question 1: The table
I've got this Venue object: public class Venue { public int Id { get;
Got code like: <?php require_once(../classes/pdo.class.php); $db = new mysql(); $db->connect(); class votingpanel{ public function
Got a bunch of UIButtons, some of which need to change colour depending on
Got the following message which doesn't seem to be common online: fatal: unknown style
I've got a simple UnitOfWork pattern going with Entity Framework 4, like so: public
I currently have made a UnitOfWork implementation which wraps both the database connection and
Got lotus notes version 8.5. I need it to show html img properly. <a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.