BlazorStart/Start/Shared/BookmarkContainerDto.cs

29 lines
801 B
C#
Raw 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; }
public IList<BookmarkGroupDto>? BookmarkGroups { get; set; }
public BookmarkContainerDto(string title) {
this.Title = title;
}
public BookmarkContainerDto(int bookmarkContainerId, string title) : this(title) {
this.BookmarkContainerId = bookmarkContainerId;
}
[JsonConstructor]
2021-11-14 04:27:59 +00:00
public BookmarkContainerDto(int bookmarkContainerId, string title,
2021-11-16 05:44:16 +00:00
IList<BookmarkGroupDto>? bookmarkGroups) : this(bookmarkContainerId, title) {
2021-11-14 04:27:59 +00:00
this.BookmarkGroups = bookmarkGroups;
}
}
}