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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:28:23+00:00 2026-06-01T10:28:23+00:00

I want to pass a property list of a class to a function. with

  • 0

I want to pass a property list of a class to a function. with in the function based on property list I’m going to generate a query. As exactly same functionality in Linq Select method.
Here I’m gonna implement this for Ingress Database.

As an example,

in front end I wanna run a select as this,

My Entity Class is like this

public class Customer
{
    [System.Data.Linq.Mapping.ColumnAttribute(Name="Id",IsPrimaryKey=true)]
    public string Id { get; set; }

    [System.Data.Linq.Mapping.ColumnAttribute(Name = "Name")]
    public string Name { get; set; }

    [System.Data.Linq.Mapping.ColumnAttribute(Name = "Address")]
    public string Address { get; set; }

    [System.Data.Linq.Mapping.ColumnAttribute(Name = "Email")]
    public string Email { get; set; }

    [System.Data.Linq.Mapping.ColumnAttribute(Name = "Mobile")]
    public string Mobile { get; set; }
}

I wanna call a Select function like this,

var result = dataAccessService.Select<Customer>(C=>C.Name,C.Address);

then,using result I can get the Name and Address properties’ values.

I think my Select function should looks like this,

( *I think this should done using Linq Expression. But im not sure what are the input parameter and return type. * )

Class DataAccessService
{
   // I'm not sure about this return type and input types, generic types.
   public TResult Select<TSource,TResult>(Expression<Func<TSource,TResult>> selector)
   {
        // Here I wanna Iterate through the property list, which is passed from the caller.
        // Here using the property list, 
        // I can get the ColumnAttribute name value and I can generate a select query.
   }
}

This is a attempt to create a functionality like in Linq. But im not an expert in Linq Expressions.

There is a project call DbLinq from MIT, but its a big project and still i couldn’t grab anything helpful from that.

Can someone please help me to start this, or can someone link me some useful resources to read about this.

  • 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-01T10:28:24+00:00Added an answer on June 1, 2026 at 10:28 am

    What you’re trying to do is creating a new anonymous type that consists of Name and Address. This is easily achievable via long form linq (I made that term up, for lack of a better explanation.) Here’s a sample from Microsoft, link provided below:

    public void Linq11() 
    { 
        List<Product> products = GetProductList(); 
    
        var productInfos = 
            from p in products 
            select new { p.ProductName, p.Category, Price = p.UnitPrice }; 
    
        Console.WriteLine("Product Info:"); 
        foreach (var productInfo in productInfos) 
        { 
            Console.WriteLine("{0} is in the category {1} and costs {2} per unit.", productInfo.ProductName, productInfo.Category, productInfo.Price); 
        } 
    }
    

    Details: Linq Select Samples

    Update:
    So are you trying to do something like this then?

       var result = dataAccessService.Select<Customer>(c => c.Name, c => c.Address);
    
    public object[] Select<TSource>(params Expression<Func<TSource, object>>[] selectors)
       {
           var toReturn = new object[selectors.Count()];
    
           foreach (var s in selectors)
           {
               var func = s.Compile();
               //TODO: If you implement Select a proper extension method, you can easily get the source
               toReturn[i] = func(TSource);
           }
            return toReturn;
       }
    

    I don’t understand why you’re trying to implement Select as a function of DataAccessService? Are trying to create this as an extension method rather?
    If this is not what you mean though, you need to rephrase you’re question big time and as one commenter suggested, tell us what you need not how you want us to design it.

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

Sidebar

Related Questions

I want to pass an int list (List) as a declarative property to a
I want to pass anonymous property using lambda to a generic function and access
I am using the following code.I want to pass property bgcolor as argument <!DOCTYPE
I want pass a class-instace to a method of an other and be sure
I want to pass '#' to the query string like ?page.aspx?someParam=1234#5 .
<display:table name=sessionScope.userInbox pagesize=5 sort=list cellspacing=10 cellpadding=5> <display:column property=aid title= class=hidden /> <display:column property=from title=From
I want to get an array(or list) of a POJO's property names . I
ok, ive a class and i pass an object as property. the object that
I have a list that i want to group based on properties on an
My data is just number, I want pass it from VC1 to VC2 for

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.