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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:00:11+00:00 2026-05-20T17:00:11+00:00

I currently am using a data structures similar to the following: public class Individual

  • 0

I currently am using a data structures similar to the following:

public class Individual
{
    //Other properties omitted for brevity sake

    public List<IndividualName> IndividualNames {get; set;}            
}

and

public class IndividualName
{
    public string FamilyName {get; set;}
    public string GivenName {get; set;}
    public string MiddleName {get; set;}
}

I am attempting to use some Dynamic search expressions to pass from my presentation layer to repository level (to actually apply the search).

However, I have run into some issues due to the fact that an Individual can have 1-M Individual Names, and I am trying to use LINQ to grab all of an Individual’s IndividualNames so they can be queried.

For example’s sake – this is what the expression currently looks like:

searchExpressions.Add(new SearchExpression("Individual
                                           .IndividualNames
                                           .Select(GivenName)
                                           .FirstOrDefault()"
             , ComparisonOperator.Contains, "Test");

This will currently only determine if the GivenName in the first IndividualName instance Contains “Test”. The above works as it should – however I am a bit stuck in terms of how I would be able to determine if Any of the IndividualNames contained the string.

Any help would be appreciated – as I have tried several things without any luck.

  • 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-20T17:00:11+00:00Added an answer on May 20, 2026 at 5:00 pm

    I think you would be looking for….

    searchExpressions.Add(new SearchExpression("Individual
                                                .IndividualNames
                                                .Select(GivenName)",
                          ComparisonOperator.Contains, "Test");
    

    You will also need to add a Contains Aggregate Method to the Dynamic Linq library. How to do this can be found here.
    http://blog.walteralmeida.com/2010/05/advanced-linq-dynamic-linq-library-add-support-for-contains-extension-.html

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

Sidebar

Related Questions

I'm currently using XmlSerializer to, surprisingly enough :), handle de/serialization of my data structures
Currently I am using NetTiers to generate my data access layer and service layer.
I am currently building an application using ASP.NET MVC. The data entry pages are
I am currently using the following command to upload my site content: scp -r
I'm extensively using hash map data structures in my program. I'm using a hash
Using redis , there are a number of commands to retrieve entire data structures
I am currently using... select Table_Name, Column_name, data_type, is_Nullable from information_Schema.Columns ...to determine information
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather

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.