示例#1
0
 private Notification(Gigs gigs, NotificationType notificationType, DateTime orginalDateTime, string orginalVenue)
 {
     DateTime        = DateTime.Now;
     Gigs            = gigs ?? throw new ArgumentNullException(nameof(gigs));
     OrginalDateTime = orginalDateTime;
     OrginalVenue    = orginalVenue;
     Type            = notificationType;
 }
示例#2
0
        public static Notification GigUpdate(Gigs newgig, DateTime orginalDateTime, string orginalVenue)
        {
            var notification = new Notification(newgig, NotificationType.GigCreate)
            {
                OrginalDateTime = orginalDateTime,
                OrginalVenue    = orginalVenue
            };

            return(notification);
        }
示例#3
0
 public static Notification GigCancel(Gigs gigs)
 {
     return(new Notification(gigs, NotificationType.GigCanceled));
 }
示例#4
0
 public static Notification GigCreate(Gigs gigs)
 {
     return(new Notification(gigs, NotificationType.GigCreate));
 }
示例#5
0
 public Notification(Gigs gigs, NotificationType notificationType)
 {
     DateTime = DateTime.Now;
     Gigs     = gigs ?? throw new ArgumentNullException(nameof(gigs));
     Type     = notificationType;
 }
示例#6
0
 public void Attending(Gig gig)
 {
     Gigs.Add(gig);
 }
示例#7
0
 //It is better to have this in a repository.
 public bool IsAttending(int gigId)
 {
     return(Gigs.Any(g => g.Id == gigId));
 }
示例#8
0
 public void NotAttending(Gig gig)
 {
     Gigs.Remove(gig);
 }