コード例 #1
0
 public async Task <bool> HasAccessToShoppingTrip(int userId, int shoppingTripId, CancellationToken cancellationToken)
 {
     return(await ShoppingTrips.AnyAsync(s => s.Id == shoppingTripId &&
                                         Members.Any(m => m.UserId == userId && m.GroupId == s.MemberGroupId), cancellationToken));
 }
コード例 #2
0
 public async Task <bool> IsCreatorOfShoppingTrip(int userId, int groupId, int shoppingTripId, CancellationToken cancellationToken)
 {
     return(await ShoppingTrips.AnyAsync(s => s.MemberUserId == userId &&
                                         s.MemberGroupId == groupId &&
                                         s.Id == shoppingTripId, cancellationToken));
 }