Reputation: 85
I have this class:
public class CarConfiguration : ObservableObject
{
[PrimaryKey, NotNull]
public long CarConfigurationId { get; set; }
public string Name { get; set; }
}
With this code I know I can get all the rows:
public List<CarConfiguration> GetUniqueCarConfigurationNames()
{
return db2.Table<CarConfiguration>().ToList();
}
But how can I get all the unique names only sorted by name?
Upvotes: 1
Views: 63
Reputation: 89102
use a Query
return db2.Query<string>("select distinct Name from CarConfiguration order by Name").ToList();
Upvotes: 2