SQLite.net: Query one single column

1.8k Views Asked by At

I have a model of the following form:

public class LanguageText
{
    [PrimaryKey]
    public int Id { get; set; }
    public string de { get; set; }
    public string en { get; set; }
    public string ru { get; set; }
}

How can I query just one column by Id? I tried this:

SQL = "SELECT [de] from [LanguageText] WHERE [Id] = \"1\""
var p = App.Database.QueryAsync<LanguageText>(SQL).Result.First();

This will return one whole row of LanguageText in p, while I want the contents of the [de] row as string only.

How do I accomplish this?

1

There are 1 best solutions below

1
On BEST ANSWER

As we found out

App.Database.ExecuteScalarAsync<string>(SQL).Result