I need to return a list of all the events and any rsvps a user may have for an event. However, regardless of the username I pass, It returns every single rsvp. My linq Query
If you just want to filter the RSVPs property of your Events in-place, then I guess you probably could do use something like
var events = _context.Context.Events;
foreach(var event in events)
{
// Assuming the property is named RSVPs
event.RSVPs = event.RSVPs.Where(o => o.UserName.Equals(userName));
}
return events;
I wouldn't consider it that neat though.