0

Do any one know how to send multiple parameter from single expression.

Please refer to my below class;

public class EMP 
{
    public string NAME { get; set; }
    public String FULLNAME { get; set; }
}

I would like to send selective property to a function, something like below.

SendColumn<EMP>(a=>{cl.NAME,cl.FULLNAME})

or

SendColumn<EMP>(cl =>cl.NAME,cl.FULLNAME)

Right now using the below function, I can only send one parameter per expression

public List<TRow> SendColumn<TValue>(Func<TRow, TValue> expression )
{
    // do some processing
}
0

1 Answer 1

2

Try using this syntax:

SendColumn(e => new EMP { NAME = "testName", FULLNAME = "TestFullName" });

If that doesn't work, please elaborate on your context and what error you are getting.

Sign up to request clarification or add additional context in comments.

3 Comments

Can you give some explanation about your answer? For me It probably won't work.
@LeonelSarmiento - The OP hasn't given enough information to get more information than this I think.
@Leonel Sarmiento - You are right. I edited my answer to use the type which was likely intended by OP rather than an anonymous type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.