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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:01:08+00:00 2026-05-30T11:01:08+00:00

Lately we’ve been having issues on entity framework saving data objects even though we

  • 0

Lately we’ve been having issues on entity framework saving data objects even though we don’t ask it to. Here’s an example:

public virtual ActionResult Index()
{
    var productListViewModel = new ProductListViewModel
                                {
                                    Products = ProductService.GetAllProducts()
                                };

    // temporarily override file url to display images
    foreach (var product in productListViewModel.Products)
    {
        product.ImageFileName = FileUploadService.GetProductThumbnailUrl(product);
    }

    return View(productListViewModel);
}

The GetProductThumbnailUrl() function returns us with a formated path string made out of a static URL + ImageFileName. However for obvious reasons we don’t want to save this path and just use it temporarily for the view.

But here’s the strange part: sometimes all of these products get saved to the database which gives us malformed urls that we can’t use.

So my question right now is what could cause this? (I’m using unity for dep. injection)


And as for a fix I just don’t change anything in the data object, and instead use a rendered action:

public ActionResult GetProductUrl(DomainModel.Product p)
{
    return Content(FileUploadService.GetProductThumbnailUrl(p));
}

And in the view:

@Html.Action(MVC.Admin.Product.GetProductUrl(p))
  • 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-30T11:01:10+00:00Added an answer on May 30, 2026 at 11:01 am

    Somewhere in there, you’re calling commit changes against the context you’re pulling from. That is the only way that is getting saved back.

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

Sidebar

Related Questions

Lately I've been running into some subtle layout issues in my iOS app. For
So lately I have been trying ways to pass data from a child to
Lately I've been writing FFI code that returns a data structure in the IO
Lately I've been in the habit of assigning integer values to constants and simply
Lately I've been using XPathDocument and XNavigator to parse an XML file for a
Lately I've been taking a look at Haxe , to build an application to
Lately, I've been going through a pretty weird phase. I feel the need to
Lately I have been playing a game on my iPhone called Scramble. Some of
Lately I have been playing around with intents and bundles. I thought I had
Lately I've been working on stored procedure and encountered 1 strange problem. First, I

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.