Table structure
[Table(TableConst.TABLE_BRANDING)]
public class BrandingInfoModel
{
public int id { get; set; }
public string title { get; set; }
public string primary_color { get; set; }
public string secondary_color { get; set; }
public string tertiary_color { get; set; }
}
Method to get resource from database
public string GetColorResourceFromDatabase(string key)
{
try
{
string value = mSqlConnection.Query<string>("SELECT " + key + " FROM data").ToString();
return value;
}
catch (Exception e)
{
string error = e.Message;
return null;
}
}
I have written the method that returns the value from the local database based on SELECT query. But it returns the null.
datatable's structure