v1 update
This commit is contained in:
@@ -34,15 +34,31 @@ namespace ToDoApp.Service
|
||||
{
|
||||
using (var context = new ToDoContext())
|
||||
{
|
||||
return context.Items.Include(i => i.User).Where(i => i.UserId == userId && i.IsCompleted != false).ToList();
|
||||
return context.Items.Include(i => i.User).Where(i => i.UserId == userId && i.IsCompleted != true).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Item> FindAllNotCompletedItems(User user)
|
||||
public List<Item> FindTodayItems(int userId)
|
||||
{
|
||||
using (var context = new ToDoContext())
|
||||
{
|
||||
return context.Items.Include(i => i.User).Where(i => i.User == user && i.IsCompleted == false).ToList();
|
||||
return context.Items.Include(i => i.User).Where(i => i.UserId == userId && i.IsCompleted != true && i.IsToday == true).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Item> FindPlannedItems(int userId)
|
||||
{
|
||||
using (var context = new ToDoContext())
|
||||
{
|
||||
return context.Items.Include(i => i.User).Where(i => i.UserId == userId && i.IsCompleted != true && i.DueDate != null).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Item> FindCompletedItems(int userId)
|
||||
{
|
||||
using (var context = new ToDoContext())
|
||||
{
|
||||
return context.Items.Include(i => i.User).Where(i => i.UserId == userId && i.IsCompleted == true).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user