I am trying to send a query like below from UI to controller.

name='abc' and title='def'

I am trying to use lambda expression on controller to filter this query. But I am struggling hard to pass ui query to controller and make it as lambda expression.

Could you please throw some idea with example where i can pass sql query(string) as parameter and use it in controller action method as lambda expression. Any link or logic should be fine for me to try further.

 [HttpGet]
 public virtual ActionResult QueriedProjects(string builtQuery)
 {
     var Helpera = new Helpera(true);

     var myProjectDetails = Helpera.myProjectDetails (null);
     var myProjectDetails = new myProjectDetails () 
     { GetMyProjectDetails = myProjectDetails  };
     return View(myProjectDeails)
 }

UI

on button click I am generating a query as string with entered values in query builder

Generated String: name='abc' and title= 'def'

share|improve this question
    
You confused me...are you talking about url query string parameters? What have you done so far? Can you add some code to your question so we can properly "guess" what you are talking about? – Leo Dec 27 '13 at 2:53
    
sorry. I updated question. Please let me know if there is more confusion so that I can edit it again. – Kurkula Dec 27 '13 at 3:00
    
Why do you need to do that? I mean...why dont you pass those values to the controller action method? – Leo Dec 27 '13 at 3:32
    
What filtering values do you need to pass as lambda? Name and title only? – Leo Dec 27 '13 at 3:35
    
I have a jquery UI dialog which has query builder like TFS query builder. I am taking inputs filtered by user in query builder and pass them to controller and then generate lambda expression with those inputs. I had just given sample with name and title to get logic. – Kurkula Dec 27 '13 at 4:04
up vote 1 down vote accepted

If you pass values like this:

Contoller/QueriedProjects?name=abc&title=def

You need to have 2 parameters in your controller method like:

public virtual ActionResult QueriedProjects(string name, string title)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.