diff --git a/Start/Shared/BookmarkContainerDto.cs b/Start/Shared/BookmarkContainerDto.cs new file mode 100644 index 0000000..73a0eb9 --- /dev/null +++ b/Start/Shared/BookmarkContainerDto.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Start.Shared { + public class BookmarkContainerDto { + public int BookmarkContainerId { get; set; } + [StringLength(300)] + public string Title { get; set; } + + public IList? BookmarkGroups { get; set; } + + public BookmarkContainerDto(string title) { + this.Title = title; + } + + public BookmarkContainerDto(int bookmarkContainerId, string title) : this(title) { + this.BookmarkContainerId = bookmarkContainerId; + } + + public BookmarkContainerDto(int bookmarkContainerId, string title, + IList bookmarkGroups) : this(bookmarkContainerId, title) { + this.BookmarkGroups = bookmarkGroups; + } + } +} diff --git a/Start/Shared/BookmarkDto.cs b/Start/Shared/BookmarkDto.cs new file mode 100644 index 0000000..04ce10d --- /dev/null +++ b/Start/Shared/BookmarkDto.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel.DataAnnotations; + +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; } + + public BookmarkDto(string title, string url, string? notes) { + this.Title = title; + this.Url = url; + this.Notes = notes; + } + + public BookmarkDto(int bookmarkId, string title, string url, string? notes) + : this(title, url, notes) { + this.BookmarkId = bookmarkId; + } + } +} diff --git a/Start/Shared/BookmarkGroupDto.cs b/Start/Shared/BookmarkGroupDto.cs new file mode 100644 index 0000000..cfafd4e --- /dev/null +++ b/Start/Shared/BookmarkGroupDto.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Start.Shared { + public class BookmarkGroupDto { + public int BookmarkGroupId { get; set; } + [StringLength(300)] + public string Title { get; set; } + [StringLength(6)] + public string Color { get; set; } + + public IList? Bookmarks { get; set; } + + public BookmarkGroupDto(string title, string color) { + this.Title = title; + this.Color = color; + } + + public BookmarkGroupDto(int bookmarkGroupId, string title, string color) + : this(title, color) { + this.BookmarkGroupId = bookmarkGroupId; + } + + public BookmarkGroupDto(int bookmarkGroupId, string title, string color, + IList bookmarks) : this(bookmarkGroupId, title, color) { + this.Bookmarks = bookmarks; + } + } +}