Updated the proostekrant to work properly again.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
namespace ProostenKrant.Models;
|
||||
|
||||
public class Article
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; } = "";
|
||||
public string Content { get; set; } = "";
|
||||
public int AuthorId { get; set; }
|
||||
public string AuthorName { get; set; } = "";
|
||||
public string? SeasonName { get; set; }
|
||||
public string? Participants { get; set; }
|
||||
public DateTime? EventDate { get; set; }
|
||||
public int? SeasonId { get; set; }
|
||||
public string? ArticleImage { get; set; }
|
||||
public string Status { get; set; } = "draft";
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public List<int> ParticipantIds
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Participants))
|
||||
{
|
||||
return new List<int>();
|
||||
}
|
||||
var parts = Participants.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||
var ids = new List<int>();
|
||||
foreach (var p in parts)
|
||||
{
|
||||
if (int.TryParse(p, out var id))
|
||||
{
|
||||
ids.Add(id);
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
|
||||
public string? WebImage => string.IsNullOrEmpty(ArticleImage)
|
||||
? null
|
||||
: $"/{ArticleImage.TrimStart('/')}";
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ProostenKrant.Models;
|
||||
|
||||
public class Season
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string? Description { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public string CssKey => Name.ToLowerInvariant() switch
|
||||
{
|
||||
"lente" => "lente",
|
||||
"zomer" => "zomer",
|
||||
"herfst" => "herfst",
|
||||
_ => "winter"
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ProostenKrant.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; } = "";
|
||||
public string DisplayName { get; set; } = "";
|
||||
public string? ProfileImage { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user