Skip to content

Commit

Permalink
stormideas#6 Show not only owned list but also lists with assigned items
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Gubal committed Apr 25, 2022
1 parent b59ba40 commit df854da
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Todo/Services/ApplicationDbContextConvenience.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Todo.Data;
using Todo.Data.Entities;
Expand All @@ -13,7 +11,7 @@ public static IQueryable<TodoList> RelevantTodoLists(this ApplicationDbContext d
{
return dbContext.TodoLists.Include(tl => tl.Owner)
.Include(tl => tl.Items)
.Where(tl => tl.Owner.Id == userId);
.Where(tl => tl.Owner.Id == userId || tl.Items.Any(i=>i.ResponsiblePartyId == userId));
}

public static TodoList SingleTodoList(this ApplicationDbContext dbContext, int todoListId, bool hideCompleted = false)
Expand Down

0 comments on commit df854da

Please sign in to comment.