Add Note and NoteHistory entities with configurations and service implementation
This commit introduces the Note and NoteHistory entities, along with their respective configurations for Entity Framework Core. The AppDbContext has been updated to include DbSet properties for both entities. A new INotesService interface and its implementation, NotesService, have been created to handle CRUD operations for notes, including history tracking. Additionally, several Blazor components have been added for note management, including dialogs for editing notes and viewing note history. The UI has been enhanced to support markdown content rendering and improved user interaction for note creation and editing. These changes contribute to a comprehensive note-taking feature within the application.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Core.Entities;
|
||||
|
||||
public class Note
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(200)]
|
||||
[Display(Name = "Title")]
|
||||
public string Title { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Content")]
|
||||
public string? Content { get; set; }
|
||||
|
||||
[Display(Name = "Created At")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[Display(Name = "Updated At")]
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
[Display(Name = "Created By")]
|
||||
public string? CreatedBy { get; set; }
|
||||
|
||||
[Display(Name = "Last Modified By")]
|
||||
public string? LastModifiedBy { get; set; }
|
||||
|
||||
public List<NoteHistory> NoteHistories { get; } = [];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Core.Entities;
|
||||
|
||||
public class NoteHistory
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Note Id")]
|
||||
public int NoteId { get; set; }
|
||||
|
||||
[StringLength(200)]
|
||||
[Display(Name = "Title")]
|
||||
public string Title { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Content")]
|
||||
public string? Content { get; set; }
|
||||
|
||||
[Display(Name = "Modified By")]
|
||||
public string? ModifiedBy { get; set; }
|
||||
|
||||
[Display(Name = "Modified At")]
|
||||
public DateTime ModifiedAt { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
[Display(Name = "Change Type")]
|
||||
public string ChangeType { get; set; } = null!;
|
||||
|
||||
public Note Note { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user