mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 09:01:18 +03:00
play with storing valueobjects
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using Ardalis.GuardClauses;
|
||||
using PracticeCalendar.Domain.Common;
|
||||
|
||||
namespace PracticeCalendar.Domain.Entities.PracticeEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Attendee to an event
|
||||
/// </summary>
|
||||
public class Attendee : EntityBase
|
||||
{
|
||||
public Attendee(string name, string emailAddress)
|
||||
{
|
||||
Guard.Against.NullOrEmpty(name);
|
||||
Guard.Against.NullOrEmpty(emailAddress);
|
||||
Name = name;
|
||||
EmailAddress = emailAddress;
|
||||
}
|
||||
|
||||
public int PracticeEventId { get; private set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string EmailAddress { get; set; } = string.Empty;
|
||||
public bool IsAttending { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set if the Attendee is attending
|
||||
/// </summary>
|
||||
/// <param name="isAttending"></param>
|
||||
public void SetIsAttending(bool isAttending)
|
||||
{
|
||||
this.IsAttending = isAttending;
|
||||
//TODO - raise event
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assign Attendee to the practice event
|
||||
/// </summary>
|
||||
/// <param name="practiceEventId"></param>
|
||||
public void AssignToEvent(int practiceEventId)
|
||||
{
|
||||
this.PracticeEventId = practiceEventId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user