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

  • Home
  • SEARCH
  • 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 7608883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:02:06+00:00 2026-05-31T01:02:06+00:00

I have WPF application project and I’m using EF. I want something like this.

  • 0

I have WPF application project and I’m using EF.
I want something like this.

NorthwindEntities nwModel = new NorthwindEntities();
Employees emp;
List mylist = GenericFunc("emp.FirstName"); => returns a List<string>
and
List mylist = GenericFunc("emp.PostalCode"); => returns a List<int>

public static List<T> GenericFunc<T>(string myfield)
{...}

Sorry if I made any mistakes.

  • 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-31T01:02:07+00:00Added an answer on May 31, 2026 at 1:02 am

    If you use a string paramter to represent a filed so :

    public static List<T> GenericFunc<T>(string myfield, string TABLENAME)
    {
       return nwModel.ExecuteQuery<T>("SELECT " + myfield + " FROM " + TABLENAME).ToList();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have the beginnings of a modular wpf application built using prism. We want
I have a project I'm working on that requires our WPF application read SMS
I have a WPF application using Aero Glass. When using the application under a
I have just changed my WPF application from .Net3.5 to .Net4. Doing this caused
I have a WPF application and I added to the project resources many icons
We have a WPF application and we are using TFS 2010 for continuous integration.
I have a WPF application using service references to a WCF service. When doing
I have a TabControl in my WPF application. I want my application to basically
I have a Wpf application project called WpfTest which references WpfTestLib (A class library).
I have two projects in my solution. The first project is a WPF application,

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.