BlazorStart/Start/Shared/BookmarkContainerDto.cs
2021-11-28 16:21:15 -08:00

30 lines
815 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Start.Shared {
public class BookmarkContainerDto {
public int BookmarkContainerId { get; set; }
[Required]
[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]
public BookmarkContainerDto(int bookmarkContainerId, string title,
IList<BookmarkGroupDto>? bookmarkGroups) : this(bookmarkContainerId, title) {
this.BookmarkGroups = bookmarkGroups;
}
}
}