public class CalendarItem{ protected internal readonly string Id = Guid.NewGuid().ToString(); public DateTime Start { get; set; } public DateTime? End { get; set; } public bool AllDay { get; set; } public string Text { get; set; } = string.Empty; protected internal bool IsMultiDay { get { if (End.HasValue || !(Start.TimeOfDay > TimeSpan.FromHours(23.0))) { if (End.HasValue) { return End.Value.Date > Start.Date; } return false; } return true; } }}
public new string Id { get; set; } = Guid.NewGuid().ToString();[NotMapped]public DateTime Start{ get { return StartDate; } set { StartDate = value; }}[NotMapped]public DateTime? End{ get { return StartDate + Duration; } set { value ??= StartDate + Duration; Duration = value.Value - StartDate; }}[NotMapped]public bool AllDay { get; set; }[NotMapped]public string Text{ get { return Name ?? string.Empty; } set { Name = value; }}