BlazorStart/Start/Server/Models/BookmarkGroup.cs
2021-11-12 19:21:59 -08:00

37 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Start.Server.Models {
/// <summary>A group of <see cref="Bookmark"/>s</summary>
public class BookmarkGroup {
/// <summary>A unique ID for the group</summary>
[Key]
public int BookmarkGroupId { get; set; }
/// <summary>The title of the group</summary>
[MaxLength(300)]
public string Title { get; set; }
/// <summary>A hex color for the group</summary>
[MaxLength(6)]
public string Color { get; set; }
/// <summary>The unique ID of the container this group is in</summary>
public int BookmarkContainerId { get; set; }
/// <summary>The container this group is in</summary>
public BookmarkContainer? BookmarkContainer { get; set; }
/// <summary>The bookmarks in this group</summary>
public List<Bookmark>? Bookmarks { get; set; }
public BookmarkGroup(string title, string color) {
this.Title = title;
this.Color = color;
}
public BookmarkGroup(int bookmarkGroupId, string title, string color) : this(title, color) {
this.BookmarkGroupId = bookmarkGroupId;
}
}
}