using System;
using System.ComponentModel.DataAnnotations;
namespace Start.Server.Models {
/// A bookmark with display text and a URL to link to
public class Bookmark {
/// A unique ID for the bookmark
[Key]
public int BookmarkId { get; set; }
/// The text to display for the bookmark
[MaxLength(300)]
public string Title { get; set; }
/// The URL the bookmark links to
[MaxLength(2000)] // De facto max length of URLs
public string Url { get; set; }
/// Arbitrary notes about the bookmark
[MaxLength(5000)]
public string? Notes { get; set; }
/// The unique ID for the group the bookmark is in
public int BookmarkGroupId { get; set; }
/// The group the bookmark is in
public BookmarkGroup? BookmarkGroup { get; set; }
public Bookmark(string title, string url, string? notes, int bookmarkGroupId) {
this.Title = title;
this.Url = url;
this.Notes = notes;
this.BookmarkGroupId = bookmarkGroupId;
}
public Bookmark(int bookmarkId, string title, string url, string? notes, int bookmarkGroupId)
: this(title, url, notes, bookmarkGroupId) {
this.BookmarkId = bookmarkId;
}
}
}