feat(Documents) Notes/Docs page improvements and warning cleanup
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Model.Doc;
|
||||
|
||||
public class DocConnectionModel
|
||||
{
|
||||
[Key] public int Id { get; set; } = 1;
|
||||
public int ParentId { get; set; } = 1;
|
||||
public int ChildId { get; set; } = 1;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Model.Doc;
|
||||
|
||||
public class DocContentModel
|
||||
{
|
||||
[Key] public int Id { get; set; } = 1;
|
||||
|
||||
public int? ParentId { get; set; } = null;
|
||||
public int? DocSectionModelId { get; set; } = null;
|
||||
public string Href { get; set; }
|
||||
[NotMapped] public virtual ICollection<DocContentModel> DocumentationModels { get; set; } = new List<DocContentModel>();
|
||||
[NotMapped] public virtual DocContentModel Parent { get; set; }
|
||||
[NotMapped] public virtual int PageOrder { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public DateTime UpdatedDate { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string Description { get; set; } = null;
|
||||
public string Content { get; set; } = "";
|
||||
|
||||
private string GetLink()
|
||||
{
|
||||
var link = Href;
|
||||
|
||||
if (Parent != null) link = $"{Parent.GetLink()}/" + link;
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
public string GetDocLink()
|
||||
{
|
||||
return $"docs/{GetLink()}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Model.Doc;
|
||||
|
||||
public class DocSectionModel
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public virtual ICollection<DocContentModel> DocumentationModels { get; set; } = new List<DocContentModel>();
|
||||
}
|
||||
Reference in New Issue
Block a user