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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:29:24+00:00 2026-05-28T01:29:24+00:00

I am using massive to get the config table in the database. I would

  • 0

I am using massive to get the config table in the database. I would like to cache the config since the app gets values from it all the time.

once cached is there an easy way to find the object where name = ‘something’

here is where the whole table is cached.

    protected override dynamic Get()
    { 
        var ret = HttpRuntime.Cache["Config"]; 
        if (ret == null)
        { 
            ret = _table.All(); 
            HttpRuntime.Cache.Add("Config", ret, null, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration,CacheItemPriority.Low, null );
        }
        return ret; 
    } 

here is where I would like to pull one record from that method

    protected override dynamic Get(string name)
    {
        return this.Get().Where(x => x.Name == name ).SingleOrDefault(); 
    }

I know linq or lambda statements are not allowed in dynamic objects. but what is the next best way to pull that one object out of that list?

  • 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-28T01:29:25+00:00Added an answer on May 28, 2026 at 1:29 am

    You could not write the lamda expression directly as the Where argument, but you could assign it to a Func variable.
    Also I believe extension methods would not work on dynamic objects, so you have to call the extension method directly.

    I think you could use the below code,

            Func<dynamic, bool> check = x => x.Name == name;
            System.Linq.Enumerable.Where<dynamic>(this.Get(), check);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to get a byte[] from a float[] as quickly as possible,
When using a database normalized accoring to 6NF principles, how would you store historical
I'm using Rob Conery's Massive to connect to my database, but I don't seem
We're considering using UUID values as primary keys for our MySQL database. The data
I'm trying to get webrat to select a radio button from a list, using
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I'm using .net web config to create trace listener for debug and trace output
I'm using PHP to json encode a massive multi-dimensional array of events, so i
I'm currently having massive trouble with Vimeo's Oauth implementation and my desktop app. My
I'm working on a small application from scratch and using it to try to

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.