//Saurabh : Instead of attendences we need following of the creator public void Create(ApplicationDbContext context, Gig gig) { var notification = Notification.GigCreated(gig); context.Gigs.Add(gig); context.Notifications.Add(notification); Attendences.Select(a => a.Attende).ToList().ForEach(a => a.Notify(notification)); }
public void Create() { Notification notification = Notification.GigCreated(this); foreach (ApplicationUser followee in Artist.Followers.Select(f => f.Followee)) { followee.Notify(notification); } }
public void Create() { var notification = Notification.GigCreated(this); foreach (var attendee in Attendances.Select(a => a.Attendee)) { attendee.Notify(notification); } }
public void Create(ICollection <ApplicationUser> attendees) { var notification = Notification.GigCreated(this); foreach (var attendee in attendees) { attendee.Notify(notification); } }
//Saurabh, don't pass context here, its bad design public void Cancel(ApplicationDbContext context) { IsCancelled = true; var notification = Notification.GigCreated(this); context.Notifications.Add(notification); Attendences.Select(a => a.Attende).ToList().ForEach(a => a.Notify(notification)); }