BlazorStart/Start/Shared/BookmarkDto.cs

34 lines
920 B
C#
Raw Permalink Normal View History

2021-12-14 00:27:13 +00:00
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
2021-11-14 04:27:59 +00:00
namespace Start.Shared {
public class BookmarkDto {
public int BookmarkId { get; set; }
[StringLength(300)]
public string Title { get; set; }
[StringLength(2000)]
public string Url { get; set; }
[StringLength(5000)]
public string? Notes { get; set; }
2022-04-19 20:04:38 +00:00
public int SortOrder { get; set; }
2021-11-14 04:27:59 +00:00
2021-12-14 00:27:13 +00:00
public int BookmarkGroupId { get; set; }
2022-04-19 20:04:38 +00:00
public BookmarkDto(string title, string url, string? notes, int sortOrder,
int bookmarkGroupId) {
2021-11-14 04:27:59 +00:00
this.Title = title;
this.Url = url;
this.Notes = notes;
2022-04-19 20:04:38 +00:00
this.SortOrder = sortOrder;
2021-12-14 00:27:13 +00:00
this.BookmarkGroupId = bookmarkGroupId;
2021-11-14 04:27:59 +00:00
}
2021-12-14 00:27:13 +00:00
[JsonConstructor]
2022-04-19 20:04:38 +00:00
public BookmarkDto(int bookmarkId, string title, string url, string? notes, int sortOrder,
2021-12-14 00:27:13 +00:00
int bookmarkGroupId)
2022-04-19 20:04:38 +00:00
: this(title, url, notes, sortOrder, bookmarkGroupId) {
2021-11-14 04:27:59 +00:00
this.BookmarkId = bookmarkId;
}
}
}