Implements directory browser dialog, part 1: file system treeview

This commit is contained in:
BinaryAlley committed 2024-09-15 13:07:53 +03:00
1 parent 4a53348013
commit 4e4ecbbfca
318 files changed
+6012 -1184

No files matched your search

@@ -1,23 +1,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Models.Books;
using Lumina.Application.Common.Models.Common;
using Lumina.Contracts.Models.Common;
using Lumina.Contracts.Models.WrittenContentLibrary.BookLibrary;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.Collections.Generic;
#endregion
namespace Lumina.DataAccess.Common.Configuration;
/// <summary>
/// Configures the entity mapping for the <see cref="BookDto"/> entity.
/// Configures the entity mapping for the <see cref="BookModel"/> entity.
/// </summary>
public class BookConfiguration : IEntityTypeConfiguration<BookDto>
public class BookConfiguration : IEntityTypeConfiguration<BookModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="BookDto"/> entity.
/// Configures the <see cref="BookModel"/> entity.
/// </summary>
/// <param name="builder">The builder to be used to configure the entity.</param>
public void Configure(EntityTypeBuilder<BookDto> builder)
public void Configure(EntityTypeBuilder<BookModel> builder)
{
builder.ToTable("Books");
builder.HasKey(book => book.Id);
@@ -46,8 +47,8 @@ public class BookConfiguration : IEntityTypeConfiguration<BookDto>
.WithMany()
.UsingEntity<Dictionary<string, object>>(
"BookTags",
j => j.HasOne<TagDto>().WithMany().HasForeignKey("TagId"),
j => j.HasOne<BookDto>().WithMany().HasForeignKey("BookId"),
j => j.HasOne<TagModel>().WithMany().HasForeignKey("TagId"),
j => j.HasOne<BookModel>().WithMany().HasForeignKey("BookId"),
j =>
{
j.HasKey("BookId", "TagId");
@@ -58,8 +59,8 @@ public class BookConfiguration : IEntityTypeConfiguration<BookDto>
.WithMany()
.UsingEntity<Dictionary<string, object>>(
"BookGenres",
j => j.HasOne<GenreDto>().WithMany().HasForeignKey("GenreId"),
j => j.HasOne<BookDto>().WithMany().HasForeignKey("BookId"),
j => j.HasOne<GenreModel>().WithMany().HasForeignKey("GenreId"),
j => j.HasOne<BookModel>().WithMany().HasForeignKey("BookId"),
j =>
{
j.HasKey("BookId", "GenreId");
@@ -83,12 +84,12 @@ public class BookConfiguration : IEntityTypeConfiguration<BookDto>
builder.Property(book => book.Created).HasColumnOrder(30);
builder.Property(book => book.Updated).HasColumnOrder(31);
//builder.HasMany<ContributorIdDto>()
//builder.HasMany<ContributorIdModel>()
//.WithMany()
//.UsingEntity<Dictionary<string, object>>(
// "BookContributors",
// j => j.HasOne<ContributorIdDto>().WithMany().HasForeignKey("ContributorId"),
// j => j.HasOne<BookDto>().WithMany().HasForeignKey("BookId"),
// j => j.HasOne<ContributorIdModel>().WithMany().HasForeignKey("ContributorId"),
// j => j.HasOne<BookModel>().WithMany().HasForeignKey("BookId"),
// j =>
// {
// j.HasKey("BookId", "ContributorId");
@@ -150,9 +151,9 @@ public class BookConfiguration : IEntityTypeConfiguration<BookDto>
#endregion
}
//public class ContributorConfiguration : IEntityTypeConfiguration<ContributorIdDto>
//public class ContributorConfiguration : IEntityTypeConfiguration<ContributorIdModel>
//{
// public void Configure(EntityTypeBuilder<ContributorIdDto> builder)
// public void Configure(EntityTypeBuilder<ContributorIdModel> builder)
// {
// builder.ToTable("Contributors");
// builder.HasKey(c => c.Id);
@@ -1,5 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Models.Common;
using Lumina.Contracts.Models.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
#endregion
@@ -7,16 +7,16 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Lumina.DataAccess.Common.Configuration;
/// <summary>
/// Configures the entity mapping for the <see cref="GenreDto"/> entity.
/// Configures the entity mapping for the <see cref="GenreModel"/> entity.
/// </summary>
public class GenreConfiguration : IEntityTypeConfiguration<GenreDto>
public class GenreConfiguration : IEntityTypeConfiguration<GenreModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="GenreDto"/> entity.
/// Configures the <see cref="GenreModel"/> entity.
/// </summary>
/// <param name="builder">The builder to be used to configure the entity.</param>
public void Configure(EntityTypeBuilder<GenreDto> builder)
public void Configure(EntityTypeBuilder<GenreModel> builder)
{
builder.ToTable("Genres");
builder.HasKey(genre => genre.Name);
@@ -1,5 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Models.Common;
using Lumina.Contracts.Models.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
#endregion
@@ -7,16 +7,16 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Lumina.DataAccess.Common.Configuration;
/// <summary>
/// Configures the entity mapping for the <see cref="TagDto"/> entity.
/// Configures the entity mapping for the <see cref="TagModel"/> entity.
/// </summary>
public class TagConfiguration : IEntityTypeConfiguration<TagDto>
public class TagConfiguration : IEntityTypeConfiguration<TagModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="TagDto"/> entity.
/// Configures the <see cref="TagModel"/> entity.
/// </summary>
/// <param name="builder">The builder to be used to configure the entity.</param>
public void Configure(EntityTypeBuilder<TagDto> builder)
public void Configure(EntityTypeBuilder<TagModel> builder)
{
builder.ToTable("Tags");
builder.HasKey(tag => tag.Name);
@@ -1,11 +1,15 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Core.UoW;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using System.Reflection;
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
using Lumina.DataAccess.Core.Repositories.Common.Factory;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.DataAccess.Core.Repositories.Common.Factory;
using Lumina.DataAccess.Core.UoW;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
#endregion
namespace Lumina.DataAccess.Common.DependencyInjection;
@@ -50,7 +50,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("BookTags", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookModel", b =>
{
b.Property<Guid>("Id")
.HasColumnType("TEXT")
@@ -197,7 +197,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("Books", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Common.GenreDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Common.GenreModel", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
@@ -208,7 +208,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("Genres", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Common.TagDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Common.TagModel", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
@@ -221,13 +221,13 @@ namespace Lumina.DataAccess.Common.Migrations
modelBuilder.Entity("BookGenres", b =>
{
b.HasOne("Lumina.Application.Common.Models.Books.BookDto", null)
b.HasOne("Lumina.Application.Common.Models.Books.BookModel", null)
.WithMany()
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Lumina.Application.Common.Models.Common.GenreDto", null)
b.HasOne("Lumina.Application.Common.Models.Common.GenreModel", null)
.WithMany()
.HasForeignKey("GenreId")
.OnDelete(DeleteBehavior.Cascade)
@@ -236,22 +236,22 @@ namespace Lumina.DataAccess.Common.Migrations
modelBuilder.Entity("BookTags", b =>
{
b.HasOne("Lumina.Application.Common.Models.Books.BookDto", null)
b.HasOne("Lumina.Application.Common.Models.Books.BookModel", null)
.WithMany()
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Lumina.Application.Common.Models.Common.TagDto", null)
b.HasOne("Lumina.Application.Common.Models.Common.TagModel", null)
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookModel", b =>
{
b.OwnsMany("Lumina.Application.Common.Models.Books.BookRatingDto", "Ratings", b1 =>
b.OwnsMany("Lumina.Application.Common.Models.Books.BookRatingModel", "Ratings", b1 =>
{
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -284,7 +284,7 @@ namespace Lumina.DataAccess.Common.Migrations
.HasForeignKey("BookId");
});
b.OwnsMany("Lumina.Application.Common.Models.Books.IsbnDto", "ISBNs", b1 =>
b.OwnsMany("Lumina.Application.Common.Models.Books.IsbnModel", "ISBNs", b1 =>
{
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -47,7 +47,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("BookTags", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookModel", b =>
{
b.Property<Guid>("Id")
.HasColumnType("TEXT")
@@ -194,7 +194,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("Books", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Common.GenreDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Common.GenreModel", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
@@ -205,7 +205,7 @@ namespace Lumina.DataAccess.Common.Migrations
b.ToTable("Genres", (string)null);
});
modelBuilder.Entity("Lumina.Application.Common.Models.Common.TagDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Common.TagModel", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
@@ -218,13 +218,13 @@ namespace Lumina.DataAccess.Common.Migrations
modelBuilder.Entity("BookGenres", b =>
{
b.HasOne("Lumina.Application.Common.Models.Books.BookDto", null)
b.HasOne("Lumina.Application.Common.Models.Books.BookModel", null)
.WithMany()
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Lumina.Application.Common.Models.Common.GenreDto", null)
b.HasOne("Lumina.Application.Common.Models.Common.GenreModel", null)
.WithMany()
.HasForeignKey("GenreId")
.OnDelete(DeleteBehavior.Cascade)
@@ -233,22 +233,22 @@ namespace Lumina.DataAccess.Common.Migrations
modelBuilder.Entity("BookTags", b =>
{
b.HasOne("Lumina.Application.Common.Models.Books.BookDto", null)
b.HasOne("Lumina.Application.Common.Models.Books.BookModel", null)
.WithMany()
.HasForeignKey("BookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Lumina.Application.Common.Models.Common.TagDto", null)
b.HasOne("Lumina.Application.Common.Models.Common.TagModel", null)
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookDto", b =>
modelBuilder.Entity("Lumina.Application.Common.Models.Books.BookModel", b =>
{
b.OwnsMany("Lumina.Application.Common.Models.Books.BookRatingDto", "Ratings", b1 =>
b.OwnsMany("Lumina.Application.Common.Models.Books.BookRatingModel", "Ratings", b1 =>
{
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -281,7 +281,7 @@ namespace Lumina.DataAccess.Common.Migrations
.HasForeignKey("BookId");
});
b.OwnsMany("Lumina.Application.Common.Models.Books.IsbnDto", "ISBNs", b1 =>
b.OwnsMany("Lumina.Application.Common.Models.Books.IsbnModel", "ISBNs", b1 =>
{
b1.Property<int>("Id")
.ValueGeneratedOnAdd()