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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:59:25+00:00 2026-05-23T07:59:25+00:00

For a new MVC project I was planning to learn and use Entity Framework

  • 0

For a new MVC project I was planning to learn and use Entity Framework EF4.1. More as a way of educating myself with EF than for any other reason. A lot of Microsoft developer demonstrations use EF as their data access tool of choice.

However, the more I’m discovering about EF, the more issues I have with it. For example…

I want to save my customers’ “basket” at the beginning of the checkout process. It’s easy and fast to save the basket to a database using EF4.1. I then want to persist the basket through the various page requests of the buy process. I could use EF to save and re-obtain the basket with each page request. This would work well and mean that I have a saved copy of the basket at every step. However, this might be resource hungry and slow down the process. Therefore I could do what I usually do and persist the basket in session through the buy process. However, I then have have a basket that is “detached” from EF and if changes are made to the basket through the buy process I have to somehow manually synchronise the session basket with the object saved to my database. This could be a fair amount of work and doesn’t sound like progress to me.

I’ve looked at many posts on here and various blogs and the notion of “Self Tracking Entities” looks like it could be the right fit. But many posts on here say STE is a bad idea with web applications.

So, given that many people say EF is not overkill for web applications, what is the best way to deal with the above scenario?

  • 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-05-23T07:59:26+00:00Added an answer on May 23, 2026 at 7:59 am

    However, I then have have a basket that is “detached” from EF and if changes are made to the basket through the buy process I have to somehow manually synchronise the session basket with the object saved to my database

    Why? It’s a new object, so why do you need to synchronize? You simply need to add it to the database. In other words, nothing is created in the DB until they confirm.

    Shopping basket is a natural fit for session. It’s silly to keep saving to the db every page, then reading it. Because what if they click cancel? Are you going to delete the “incomplete” object?

    Store it in session, read it from session, when they confirm the purchase simply add it to the database:

    ctx.Baskets.AddObject(newBasket).

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

Sidebar

Related Questions

I have a new MVC project which uses the entity framework. I'm spitting out
I'm planning a new project at the moment, built on MVC. Now, there are
I have started a new mvc project and clicked on project\properties\web - use local
I have created the following project structure for my new asp.net mvc project any
I'm trying to add a new ADO.Net Entity Data Model to an MVC project
If you were starting a new web development project would you use ASP.Net MVC
I'm planning work on a new project and am now tempted to use ASP.NET
I am starting a new Spring-MVC project. Validation is a important feature in any
I've just create a new MVC project, and have made no changes at all,
I am trying to start a new MVC project with tests and I thought

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.