Jan 07, 2011, 7:27 AM
A sample Code for using FilterConditions within linq to sql model in Ext.Net.MVC
First thank you Ext.net team, you have done a wonderful job.
I am working on my final project in my University and I got stuck when I have to perform a search. I have seen that just in Premium Forum there is given a solution but not the full code. I am nearlly in end of this semester and I dont have time so please if any one has already had this kind of problem could help me!?:(
This is my actual controller and I want to include gridfilters .
Any kind of help will be graceful.
Thank you,
Dynamikus
I am working on my final project in my University and I got stuck when I have to perform a search. I have seen that just in Premium Forum there is given a solution but not the full code. I am nearlly in end of this semester and I dont have time so please if any one has already had this kind of problem could help me!?:(
This is my actual controller and I want to include gridfilters .
public AjaxStoreResult GetCustomerList(int limit, int start, string dir, string sort)
{
var query = (from c in this.DbContextCustomers
select new
{
c.CustomerId,
c.CustomerName,
c.EMailAddress
}).OrderBy(string.Concat(sort, " ", dir));
int total = query.Count();
var query = query.Skip(start).Take(limit).ToList();
return new AjaxStoreResult(query , total);
}
The given sample of code in Premium help was. But there is no more code on how to construct the query string. There is given a solution within the examples but that works for Lists Data Structures not for linq to sql.public AjaxStoreResult GetCustomerList(int limit, int start, string dir, string sort, string gridfilters)
{
if (!string.IsNullOrEmpty(gridfilters))
{
FilterConditions filters = new FilterConditions(gridfilters);
}
return new AjaxStoreResult(data, total);
}
Please can anyone post a sample of code how to deal with FilterConditions filters = new FilterConditions(gridfilters); or any other way how to perform a search over db.Any kind of help will be graceful.
Thank you,
Dynamikus