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; }
public static Notification GigUpdate(Gigs newgig, DateTime orginalDateTime, string orginalVenue) { var notification = new Notification(newgig, NotificationType.GigCreate) { OrginalDateTime = orginalDateTime, OrginalVenue = orginalVenue }; return(notification); }
public static Notification GigCancel(Gigs gigs) { return(new Notification(gigs, NotificationType.GigCanceled)); }
public static Notification GigCreate(Gigs gigs) { return(new Notification(gigs, NotificationType.GigCreate)); }
public Notification(Gigs gigs, NotificationType notificationType) { DateTime = DateTime.Now; Gigs = gigs ?? throw new ArgumentNullException(nameof(gigs)); Type = notificationType; }
public void Attending(Gig gig) { Gigs.Add(gig); }
//It is better to have this in a repository. public bool IsAttending(int gigId) { return(Gigs.Any(g => g.Id == gigId)); }
public void NotAttending(Gig gig) { Gigs.Remove(gig); }