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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:54:11+00:00 2026-06-05T03:54:11+00:00

I want to cache a data collection in asp.net mvc and filter this collection

  • 0

I want to cache a data collection in asp.net mvc and filter this collection without to changed the cached collection.

Is it possible to do this?

Because for now, when I get my cached collection I get a reference to it and filter data of this collection change the cached collection.

Does anyone know?

  • 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-05T03:54:14+00:00Added an answer on June 5, 2026 at 3:54 am

    I finally resolve my problem by creating a Clone() method in each of my objects and call Clone () method on my main object just after I retrieved it from cache.

    My main object is of type account which contain himself list of domains, which contain list of product, etc…

    Here is the Clone method in the Account object :

        public Account Clone()
        {
            // Copy all properties of the object in a new object account
            var account = (Account)this.MemberwiseClone();
    
            var domainsList = new List<Domain>();
            foreach (var d in this.Domains)
            {
                domainsList.Add(d.Clone());
            }
    
            account.Domains = domainsList;
    
            return account;
        }
    

    Like you can see I use MemberwiseClone() to copy simple property and then I call Clone again on all complex objects. Clone which is a custom method I created in all of my complex objects.

    And now it work fine…

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

Sidebar

Related Questions

Currently ASP.NET MVC's OutputCache attribute has a huge downfall. If you want to cache
I want a ASP.NET cache item to be recycled when a specific file is
I have an ASP.NET MVC 3 / .NET Web Application, which is heavily data-driven,
I want to cache data from a json-webservice in my android app. The first
In my application, I want to cache the displayed data in tableview so that
I'm having trouble with caching URLResponses to disk. I want that because the data
In my application I want to cache data loaded with NHibernate. I don't want
I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
I am using Local data Cache (.sdf) in my application. I want to store
So I want to cache some data in mysql and some in memcached. at

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.