private static void CheckForReservations() { var user = new User("mircea.nistor", "Mircea Nistor", "*****@*****.**"); var reservation = new Reservation(user, "Daily LPL Meeting", new DateTime(2013, 9, 13), new DateTime(2013, 9, 13).AddHours(1)); reservation.AddParticipant(user); NotificationEmail.Send(reservation); }
public Comment(User user, string comment) { Check.NotNull(user, "user"); Check.NotEmpty(comment, "comment"); this.By = user; this.Says = comment; this.Timestamp = DateTime.Now; }
//public Reservation(User requestedBy, string title, DateTime startsAt, DateTime endsAt) // : this(requestedBy, title, startsAt, endsAt, null) { } public Reservation(User requestedBy, string title, DateTime startsAt, DateTime endsAt) { Check.NotNull(requestedBy, "requestedBy"); Check.NotEmpty(title, "title"); Check.NotEmpty(startsAt, "startsAt"); Check.NotEmpty(endsAt, "endsAt"); Check.Condition(endsAt > startsAt, "Start time must be prior to end time"); this.RequestedBy = requestedBy; this.Title = title; this.StartsAt = startsAt; this.EndsAt = endsAt; this.LastsFor = endsAt - startsAt; }
public void AddParticipant(User participant) { Check.NotNull(participant, "participant"); participants.Add(participant); }
public void AddComment(User by, string comment) { Check.NotNull(by, "by"); Check.NotEmpty(comment, "comment"); comments.Add(new Comment(by, comment)); }
public bool Authenticate(Guid token, out User authenticatedUser) { authenticatedUser = store.Load(token) as User; return authenticatedUser != null; }