Exemplo n.º 1
0
        //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));
        }
Exemplo n.º 2
0
        public void Create()
        {
            Notification notification = Notification.GigCreated(this);

            foreach (ApplicationUser followee in Artist.Followers.Select(f => f.Followee))
            {
                followee.Notify(notification);
            }
        }
Exemplo n.º 3
0
        public void Create()
        {
            var notification = Notification.GigCreated(this);

            foreach (var attendee in Attendances.Select(a => a.Attendee))
            {
                attendee.Notify(notification);
            }
        }
Exemplo n.º 4
0
        public void Create(ICollection <ApplicationUser> attendees)
        {
            var notification = Notification.GigCreated(this);

            foreach (var attendee in attendees)
            {
                attendee.Notify(notification);
            }
        }
Exemplo n.º 5
0
        //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));
        }