SharpRSS/SharpRss/Models/CategoryModel.cs

36 lines
922 B
C#
Raw Normal View History

2023-05-20 00:04:45 +02:00
using System;
2023-05-20 00:35:43 +02:00
using ToolQit;
2023-06-04 19:00:46 +02:00
using ToolQit.Extensions;
2023-05-20 00:04:45 +02:00
namespace SharpRss.Models
{
public class CategoryModel
2023-05-20 00:04:45 +02:00
{
2023-06-04 19:00:46 +02:00
private string _id = string.Empty;
public string Id
2023-05-20 00:04:45 +02:00
{
2023-06-04 19:00:46 +02:00
get
{
if (_id.IsNullEmptyWhiteSpace())
_id = Guid.NewGuid().ToString();
return _id;
}
set => _id = value;
2023-05-20 00:04:45 +02:00
}
2023-05-21 21:56:37 +02:00
public string Name { get; set; } = string.Empty;
2023-06-04 19:00:46 +02:00
private string _hexColor = string.Empty;
public string HexColor
{
get
{
if (_hexColor.IsNullEmptyWhiteSpace())
_hexColor = Utilities.GenerateRandomHexColor();
return _hexColor;
}
set => _hexColor = value;
}
2023-05-23 15:04:02 +02:00
public int FeedCount { get; set; }
2023-05-21 21:56:37 +02:00
public string Icon { get; set; } = string.Empty;
2023-05-20 00:04:45 +02:00
}
}