public class DiscordEvent : CalendarItem
{
[Key]
public int EventId { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public DateTime StartDate { get; set; }
public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1);
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime ModifiedAt { get; set; } = DateTime.UtcNow;
[NotMapped]
public new string Id { get; set; } = Guid.NewGuid().ToString();
[NotMapped]
public new DateTime Start
{
get
{
return StartDate;
}
set
{
StartDate = value;
}
}
[NotMapped]
public new DateTime? End
{
get
{
return StartDate + Duration;
}
set
{
value ??= StartDate + Duration;
Duration = value.Value - StartDate;
}
}
[NotMapped]
public new bool AllDay { get; set; }
[NotMapped]
public new string Text
{
get
{
return Name ?? string.Empty;
}
set { Name = value; }
}
[NotMapped]
public new bool IsMultiDay { get; set; }
}
public class DiscordEvent : CalendarItem
{
[Key]
public int EventId { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public DateTime StartDate { get; set; }
public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1);
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime ModifiedAt { get; set; } = DateTime.UtcNow;
[NotMapped]
public new string Id { get; set; } = Guid.NewGuid().ToString();
[NotMapped]
public new DateTime Start
{
get
{
return StartDate;
}
set
{
StartDate = value;
}
}
[NotMapped]
public new DateTime? End
{
get
{
return StartDate + Duration;
}
set
{
value ??= StartDate + Duration;
Duration = value.Value - StartDate;
}
}
[NotMapped]
public new bool AllDay { get; set; }
[NotMapped]
public new string Text
{
get
{
return Name ?? string.Empty;
}
set { Name = value; }
}
[NotMapped]
public new bool IsMultiDay { get; set; }
}