I expose my 'Example' class using IQueryable
and apply the [UseSorting]
attribute so the user can define the sort order of the results. This works fine and the Playground allows me to do exactly that.
public class QueryType : ObjectType
{
[UseSorting]
public IQueryable<Example> GetExamples([Service]IExampleRepository repository)
{
return repository.GetExamples();
}
}
public class ExampleType : ObjectType<Example>
{
protected override void Configure(IObjectTypeDescriptor<Example> descriptor)
{
}
}
But the 'Example' class has three properties and I only want 2 of them to be orderable by the user. It makes no sense for the user to order by the third property. How do you specify one of the properties of 'Example' to be excluded from the ordering middleware?