0

I have a function like this

public BuildColumn<TModel> TEST<TProperty>( Expression<Func<TModel, TProperty>> expression, string DisplayName, object HTMLAttributes, Expression<Func<TModel, string, TProperty>> SpecialHTMLAttributes, bool Show) {} 

If you look at the 4th argument, it's an Expression<Func<TModel,string,TProperty>>. What I am trying to do here is pass a lambda expression and a string value, maybe "abc" . But I could not figure out how to pass them in this argument or how to use it.
Does anyone knows how to pass 2 parameters to a System.Func<>, or is there any better alternative?

1
  • Can you demonstrate what you'd like to do or how you want to use this? It's a bit unclear to me. Commented Jan 19, 2012 at 22:04

1 Answer 1

1

Perhaps this is the parameter type you want:

Func<TModel, string, TProperty> 

Or the expression form:

Expression<Func<TModel, string, TProperty>> 

That would allow you to to pass something like this as the argument:

(model, str) => model.SomeCode(str) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.