Hi,
I'm having troubles using this method:
public ObjectQuery<E> DoQuery(string columnName, int maximumRows, int startRowIndex)
{
var result = (ObjectQuery<E>)_ctx.CreateQuery<E>
("[" + typeof(E).Name + "]").OrderBy(/*???*/).Skip<E>(startRowIndex).Take(maximumRows);
return result;
}
I'm not sure what needs to go in the OrderBy
section. I've tried leaving out .OrderBy
but it ends up giving me an error saying that it needs to be ordered so that I can take a certain amount of rows.
I want to order by the ID field. In one case I have the entity name as Row, the ID of this entity is named RowID
.
Does anyone know how I could order by the ID field?
Note: This is a generic repository using the entity framework. The columnName passed in is the column I would like to order by, but it will probably only be the name of the ID field.