BlazorStart/Start/Shared/BookmarkContainerDto.cs

32 lines
939 B
C#
Raw Permalink Normal View History

2021-12-05 23:50:48 +00:00
using System.Collections.Generic;
2021-11-14 04:27:59 +00:00
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
2021-11-14 04:27:59 +00:00
namespace Start.Shared {
public class BookmarkContainerDto {
public int BookmarkContainerId { get; set; }
[Required]
2021-11-14 04:27:59 +00:00
[StringLength(300)]
public string Title { get; set; }
2022-04-19 20:04:38 +00:00
public int SortOrder { get; set; }
2021-11-14 04:27:59 +00:00
public IList<BookmarkGroupDto>? BookmarkGroups { get; set; }
2022-04-19 20:04:38 +00:00
public BookmarkContainerDto(string title, int sortOrder) {
2021-11-14 04:27:59 +00:00
this.Title = title;
2022-04-19 20:04:38 +00:00
this.SortOrder = sortOrder;
2021-11-14 04:27:59 +00:00
}
2022-04-19 20:04:38 +00:00
public BookmarkContainerDto(int bookmarkContainerId, string title, int sortOrder)
: this(title, sortOrder) {
2021-11-14 04:27:59 +00:00
this.BookmarkContainerId = bookmarkContainerId;
}
[JsonConstructor]
2022-04-19 20:04:38 +00:00
public BookmarkContainerDto(int bookmarkContainerId, string title, int sortOrder,
IList<BookmarkGroupDto>? bookmarkGroups) : this(bookmarkContainerId, title, sortOrder) {
2021-11-14 04:27:59 +00:00
this.BookmarkGroups = bookmarkGroups;
}
}
}