BlazorStart/Start/Server/Models/BookmarkContainer.cs

36 lines
1.3 KiB
C#
Raw Normal View History

2022-04-19 20:04:38 +00:00
using System.Collections.Generic;
2021-11-13 03:21:59 +00:00
using System.ComponentModel.DataAnnotations;
namespace Start.Server.Models {
/// <summary>A group of <see cref="BookmarkGroup"/>s</summary>
public class BookmarkContainer {
/// <summary>A unique ID for the container</summary>
[Key]
public int BookmarkContainerId { get; set; }
2022-04-19 20:04:38 +00:00
/// <summary>A title to disply to the user</summary>
[MaxLength(300)]
2021-11-13 03:21:59 +00:00
public string Title { get; set; }
2022-04-19 20:04:38 +00:00
/// <summary>Used for sorting lists of bookmark containers</summary>
public int SortOrder { get; set; }
2021-11-13 03:21:59 +00:00
/// <summary>The unique ID of the user that this container belongs to</summary>
public string ApplicationUserId { get; set; }
/// <summary>The user that this container belongs to</summary>
public ApplicationUser? ApplicationUser { get; set; }
/// <summary>The <see cref="BookmarkGroup"/>s in this container</summary>
public List<BookmarkGroup>? BookmarkGroups { get; set; }
2022-04-19 20:04:38 +00:00
public BookmarkContainer(string applicationUserId, string title, int sortOrder) {
2021-11-13 03:21:59 +00:00
this.ApplicationUserId = applicationUserId;
this.Title = title;
2022-04-19 20:04:38 +00:00
this.SortOrder = sortOrder;
2021-11-13 03:21:59 +00:00
}
2022-04-19 20:04:38 +00:00
public BookmarkContainer(int bookmarkContainerId, string applicationUserId, string title,
int sortOrder) : this(applicationUserId, title, sortOrder) {
2021-11-13 03:21:59 +00:00
this.BookmarkContainerId = bookmarkContainerId;
}
}
}