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 9208227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:34:18+00:00 2026-06-18T00:34:18+00:00

My solution is divided as follows: Data project – holds Entity Framework Business Logic/Services

  • 0

My solution is divided as follows:

  • Data project – holds Entity Framework
  • Business Logic/Services project – contains classes that implement business logic/do other work on the data
  • MVC3 project

The way I have this set up is the services class does work involving entity framework. I’m using dependency injection for creating the repository wrapping Entity Framework. The problem I’m running into is that each time the repository is created via ninject, it’s creating a new EF context so not all changes are being saved. Note that I have Ninject bindings in both the services project and the MVC project, and the instance I’m talking about here is when the bindings are located in the class library.

Based on the research I’ve done, it seems to be recommended to use InRequestScope so that way the same context gets used. However, since I’m using this in a class library instead of the MVC project/web project, does it make sense to use Ninject.Web.Common in the class library (where it goes and creates AppStart folders and everything)?

Or is there another way I should handle this?

  • 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-18T00:34:19+00:00Added an answer on June 18, 2026 at 12:34 am

    I was misunderstanding how Ninject.Web.Common worked and I was getting confused by the auto-added NinjectWebCommon cs file that was automatically added via nuget install, making me think that it was only for the entry point project. I wasn’t aware that my class library would have access to HttpContext and by getting rid of the AppStart folder that the nuget package “helpfully” added, I was able to use InRequestScope in my class library.

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

Sidebar

Related Questions

My basic solution structure in every project is: Dal - Data access layer Business
I have some data that I've divided into enough groupings that standard boxplots look
I'm working in a project that is divided into multiple modules. Each module have
SOLUTION Make sure in the plist that the storyboard name is listed as the
Solution is called Portal which holds Areas/CMS/Login folder inside it. Login controller in CMS/Controllers
Hi I have an activity which holds a layout, the layout is divided into
My project is divided to PresentationLayer, BusinesLogicLayer and DataAccessLayer. Every created object goes through
I have a problem that I can't find a solution for, even after hours
I know you all probably thinking that on() is the solution and I hope
I have a problem which has an solution that can be solved by iteration,

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.