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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:41:29+00:00 2026-06-02T16:41:29+00:00

I have this simple method that returns a user: User usr = ReliableExecution.RetryWithExpression<User, User>(u

  • 0

I have this simple method that returns a user:

User usr = ReliableExecution.RetryWithExpression<User, User>(u => u.FirstOrDefault(x => x.UserEmail == userEmail));

Now I need to create a similar method, but I need to return a list

List<Asset> lst = ReliableExecution.RetryWithExpression<Asset, List<Asset>>(u => u.SelectMany(x => x.EventId == eventId));

My problem is with the [SelectMany(x => x.EventId == eventId)] part that doesn’t compile and I can’t understand exactly how to use LINQ to get multiple results.
I have specified “SelectMany” just for an example, it can be whatever you find correct.

This is the signature of RetryWithExpression for reference:

   public static TValue RetryWithExpression<T, TValue>(Func<ObjectSet<T>, TValue> func, Int32 retryInfiniteLoopGuard = 0)
         where T : class
  • 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-02T16:41:32+00:00Added an answer on June 2, 2026 at 4:41 pm

    I think your expression should be rewritten as follows:

    List<Asset> lst = ReliableExecution
        .RetryWithExpression<Asset, List<Asset>>(
            u => u.Where(x => x.EventId == eventId).ToList()
        );
    

    In simple terms, SelectMany flattens a “list of lists of items A” into a “list of items B” using a functor that extracts a list of items B from each single item A; this is not what you want to do.

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

Sidebar

Related Questions

I have a simple WebService method that returns database results as a DataSet. This
Say I have this simple method: public IEnumerable<uint> GetNumbers() { uint n = 0;
Hi I have this simple method which gets triggered when i click inside a
hopefully a pretty simple question this time. I have a Select method in a
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
This is simple xslt, that shows the login status of the current user. Everything
I have a simple Java program that allows a user to draw rectangles on
I have a method that sets up my linq data context. Before it returns
I have this simple example I can't seems to get working : MERGE INTO
i have this simple type from an external webservice: <xsd:element name=card_number maxOccurs=1 minOccurs=1> <xsd:simpleType>

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.