Start modernization

This commit is contained in:
2023-03-10 12:18:03 -05:00
parent a0214b98f1
commit f480a6c373
57 changed files with 661 additions and 2921 deletions

View File

@@ -1,15 +1,31 @@
using System;
using System.Collections.Generic;
using Realms;
namespace FeedCenter
{
public partial class Category
public class Category : RealmObject
{
private const string DefaultCategoryName = "< default >";
[PrimaryKey]
[MapTo("ID")]
public Guid Id { get; set; }
public string Name { get; set; }
[Ignored]
public ICollection<Feed> Feeds { get; set; }
public static Category Create()
{
return new Category { ID = Guid.NewGuid() };
return new Category { Id = Guid.NewGuid() };
}
public static Category CreateDefault()
{
return new Category { Id = Guid.NewGuid(), Name = DefaultCategoryName };
}
public bool IsDefault => Name == "< default >";
public bool IsDefault => Name == DefaultCategoryName;
// ReSharper disable once UnusedMember.Global
public int SortKey => IsDefault ? 0 : 1;