Skip to content

Question: why to order by a field, it needs to be in the select? #963

@marciogoularte

Description

@marciogoularte

Hi,

I'm using SQL Server and I have queries that make certain fields select and order by another

exemple:
base.Query<TEntity>(TableName(), fields: Field.From("Id", "Name"), orderBy: new List<OrderField>() { new OrderField("Created", Order.Descending) });

Throw exception here:
https://github.com/mikependon/RepoDB/blob/master/RepoDb.Core/RepoDb/StatementBuilders/BaseStatementBuilder.cs#L727

because without that it works too. What is the reason for this?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfor grabsA community can grab for contribution

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions