mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 07:01:16 +03:00
nice refactorings
This commit is contained in:
@@ -22,8 +22,7 @@ namespace PracticeCalendar.Domain.Entities
|
||||
public string Title { get; private set; } = string.Empty;
|
||||
public string Description{ get; private set; } = string.Empty;
|
||||
|
||||
private List<Attendee> attendees = new List<Attendee>();
|
||||
public IEnumerable<Attendee> Attendees => attendees.AsReadOnly();
|
||||
public IList<Attendee> Attendees { get; private set; } = new List<Attendee>();
|
||||
|
||||
public DateTime StartTime { get; private set; }
|
||||
public DateTime EndTime { get; private set; }
|
||||
@@ -32,7 +31,7 @@ namespace PracticeCalendar.Domain.Entities
|
||||
{
|
||||
Guard.Against.Null(attendee, nameof(attendee));
|
||||
attendee.AssignToEvent(this.Id);
|
||||
attendees.Add(attendee);
|
||||
Attendees.Add(attendee);
|
||||
|
||||
var attendeeAddedEvent = new AttendeeAddedEvent(this, attendee);
|
||||
base.RegisterDomainEvent(attendeeAddedEvent);
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace PracticeCalendar.Domain.Entities.Specifications
|
||||
{
|
||||
public PracticeEventsWithAttendees()
|
||||
{
|
||||
Query.Include(x => x.Attendees);
|
||||
Query.AsNoTracking()
|
||||
.Include(x => x.Attendees);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using PracticeCalendar.Domain.Common;
|
||||
|
||||
namespace PracticeCalendar.Domain.Exceptions
|
||||
{
|
||||
public class PracticeEventNotFoundException : DomainException
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user