SharpRSS/SharpRss/Models/CategoryModel.cs

34 lines
915 B
C#

using System;
namespace SharpRss.Models
{
/// <summary>
/// To store and load data from file/database
/// </summary>
public class CategoryModel
{
public CategoryModel()
{
HexColor = $"#{_random.Next(0x1000000):X6}";
CategoryId = Guid.NewGuid().ToString();
}
private readonly Random _random = new Random();
public static CategoryModel Create(string categoryName, string hexColor, string id)
{
CategoryModel catModel = new CategoryModel()
{
Name = categoryName,
HexColor = hexColor,
CategoryId = id
};
return catModel;
}
public string Name { get; set; }
public string HexColor { get; set; }
public string PathIcon { get; set; }
public string CategoryId { get; private set; }
}
}