SharpRSS/SharpRss/Models/CategoryModel.cs

33 lines
943 B
C#

using System;
using System.Collections.Generic;
using ToolQit;
using ToolQit.Extensions;
namespace SharpRss.Models
{
public class CategoryModel
{
public CategoryModel()
{
Id = Guid.NewGuid().ToString();
}
public string Id { get; set; }
public string Name { get; set; } = string.Empty;
private string _hexColor = string.Empty;
public string HexColor
{
get
{
if (_hexColor.IsNullEmptyWhiteSpace())
_hexColor = Utilities.GenerateRandomHexColor();
return _hexColor;
}
set => _hexColor = value;
}
public string Icon { get; set; } = string.Empty;
public DateTimeOffset LastUpdated { get; set; } = DateTimeOffset.Now;
public HashSet<SyndicationModel> Syndications { get; set; } = new HashSet<SyndicationModel>();
}
}