780 questions
Morning I figured it out this morning, the database values must be 1 or 0 not true and false, wood for the trees
thanks
Madaxe
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Morning,
I have a simple SQLite Database Table with two rows of data one where IsCustom is 'false' and the other 'true' my query when i use '.Where(r => r.IsCustom == false).ToListAsync();' returns both rows and when the value is 'true' returns nothing.
Can somebody help
Thanks
Madaxe
CREATE TABLE Querys (
Id TEXT PRIMARY KEY
NOT NULL,
Name TEXT,
[Query] TEXT,
IsCustom BOOLEAN
);
public async Task<IEnumerable<QueryModel>> GetAllQuerys()
{
using (HideShowWidgetDBContext context = _hideShowWidgetDBContextFactory.CreateDbContext())
{
IEnumerable<QueryDTO> queryDTOs = await context.Querys
.Where(r => r.IsCustom == false).ToListAsync();
//IEnumerable<QueryDTO> queryDTOs = await context.Querys.ToListAsync();
return queryDTOs.Select(r => new QueryModel(r.Name,r.Query,r.IsCustom));
}
}
public class QueryDTO
{
[Key]
public Guid Id { get; set; }
public string Name { get; set; }
public string Query { get; set; }
public bool IsCustom { get; set; }
}
Morning I figured it out this morning, the database values must be 1 or 0 not true and false, wood for the trees
thanks
Madaxe