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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:04:28+00:00 2026-05-21T20:04:28+00:00

For the sake of post processing on a method, I want to import an

  • 0

For the sake of “post processing” on a method, I want to import an extra function into a method.

How can I import a Func that returns an anonymous Type as a parameter for a .Select extension method?

The expression is anounymous like:

p => new
{
    ThumnailUrl = p.PicasaEntry.Media.Thumbnails[0].Attributes["url"],
    ImageUrl = p.PhotoUri
}

and needs to be used at parameter ????? and performed at .Select(?????)

private void BindControl<T, U>(string uri, DataBoundControl target, ?????)
    where T : KindQuery, new()
    where U : PicasaEntity, new()
{
    PicasaFeed feed = CreateFeed<T>(uri);
    albumList.DataSource = GetPicasaEntries<U>(feed).Select(?????);
    albumList.DataBind();
}

update:

finally I want to call it like:

    string albumUri = PicasaQuery.CreatePicasaUri(PicasaUserID, PicasaAlbumID);
    BindControls<AlbumQuery, Album>(albumUri, albumList, ?????);

    string photoUri = PicasaQuery.CreatePicasaUri(PicasaUserID, PicasaAlbumID);
    BindControls<PhotoQuery, Photo>(photoUri, slideShow, ?????);

the other methods are like:

private PicasaFeed CreateFeed<T>(string uri) 
   where T : KindQuery, new()
{
    PicasaFeed feed = null;

    try
    {
        PicasaService service = new PicasaService(PicasaApplicationName);
        T query = new T();
        query.BaseAddress = uri;
        feed = service.Query(query);
    }
    catch (Exception ex)
    {
        //exception handling not shown
    }

    return feed;
}



private IEnumerable<T> GetPicasaEntries<T>(PicasaFeed feed) 
     where T : PicasaEntity, new()
{
    if(feed == null){
        return null;
    }

    IEnumerable<T> entries = null;
    string cacheKey = feed.Id.ToString();

    if(Cache.Get(cacheKey) == null)
    {
        entries = feed.Entries.Select(x => new T() { AtomEntry = x }).ToList();
    Cache.Insert(cacheKey, entries, 
              null, Cache.NoAbsoluteExpiration, new TimeSpan(0,20,0));
    }

    return entries;
}
  • 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-21T20:04:29+00:00Added an answer on May 21, 2026 at 8:04 pm

    Anonymous types are really only designed for local use. In a strongly typed language types that can’t be strongly typed are not really encouraged for general use… They are just a part of c#s little dance in the dynamic world.

    You have two choices.

    Create a strong type.

      class Entry
      {
        public string ThumnailUrl { get; set; }
        public string ImageUrl { get; set; }
      }
    

    And then use :

      p => new Entry 
      {
         ThumnailUrl = p.PicasaEntry.Media.Thumbnails[0].Attributes["url"],
         ImageUrl = p.PhotoUri
      }
    

    Or refer to it as Object. Then use reflection to get the data out – I wouldn’t recommend this.

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

Sidebar

Related Questions

Is there a Chrome extension post install hook/API function that will let me perform
For my curiosity sake I'm looking for a dynamic object oriented language that allows
I have a inefficiently constructed form that is obviously sending one type of data
I have several related questions and post under one topic for clarity's sake. #
I want to conduct a POST request via jQuery. Say I have four Javascript
I have a resource that has a counter. For the sake of example, let's
just for knowledge sake, i wanna know that how good is to use a
I ran into a weird behavior from Oracle this morning... And I can't understand
I've got several models that I'd like to relate together hierarchically. For simplicity's sake,
So say that I have a fairly typical blog. A post belongs to a

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.