This question is locked. New answers and comments are not allowed.
I have a RadGrid which is enable paging and filtering feature. The RadGrid is bound with ObjectDataSource. My select method is defined as below:
public List<FunctionField> GetFieldData(string filterExpressions, int maximumRows, int startRowIndex)
{
using (var context = new MaintainRuleDA())
{
IQueryable<FunctionField> source = from p in context.FunctionFields
where !p.IsDeleted
select p;
if (!string.IsNullOrEmpty(filterExpressions))
{
source = source.Where(filterExpressions);
}
source = source.OrderBy(p => p.FieldName);
totalCount = source.Count();
return source.Skip(startRowIndex).Take(maximumRows).ToList();
}
}
I have two questions:
1.Whether the above code will have performance issue?
2.Currently, my RadGrid will have a column Function Name which is from another table(Function table). I need to retrieve the Function Name based on FunctionFields.FunctionId from DB in ItemDataBound event. My question is whether there is a way to return the function name in above method?
public List<FunctionField> GetFieldData(string filterExpressions, int maximumRows, int startRowIndex)
{
using (var context = new MaintainRuleDA())
{
IQueryable<FunctionField> source = from p in context.FunctionFields
where !p.IsDeleted
select p;
if (!string.IsNullOrEmpty(filterExpressions))
{
source = source.Where(filterExpressions);
}
source = source.OrderBy(p => p.FieldName);
totalCount = source.Count();
return source.Skip(startRowIndex).Take(maximumRows).ToList();
}
}
I have two questions:
1.Whether the above code will have performance issue?
2.Currently, my RadGrid will have a column Function Name which is from another table(Function table). I need to retrieve the Function Name based on FunctionFields.FunctionId from DB in ItemDataBound event. My question is whether there is a way to return the function name in above method?