eliminates region sections

This commit is contained in:
BinaryAlley committed 2024-10-12 22:03:57 +03:00
1 parent 705c02b90d
commit 405fc1ff9a
370 files changed
+47 -1618

No files matched your search

@@ -13,7 +13,6 @@ namespace Lumina.DataAccess.Common.Configuration;
/// </summary>
public class BookConfiguration : IEntityTypeConfiguration<BookModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="BookModel"/> entity.
/// </summary>
@@ -148,7 +147,6 @@ public class BookConfiguration : IEntityTypeConfiguration<BookModel>
.IsRequired();
});
}
#endregion
}
//public class ContributorConfiguration : IEntityTypeConfiguration<ContributorIdModel>
@@ -11,7 +11,6 @@ namespace Lumina.DataAccess.Common.Configuration;
/// </summary>
public class GenreConfiguration : IEntityTypeConfiguration<GenreModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="GenreModel"/> entity.
/// </summary>
@@ -22,5 +21,4 @@ public class GenreConfiguration : IEntityTypeConfiguration<GenreModel>
builder.HasKey(genre => genre.Name);
builder.Property(genre => genre.Name).IsRequired().HasMaxLength(50);
}
#endregion
}
@@ -11,7 +11,6 @@ namespace Lumina.DataAccess.Common.Configuration;
/// </summary>
public class TagConfiguration : IEntityTypeConfiguration<TagModel>
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the <see cref="TagModel"/> entity.
/// </summary>
@@ -22,5 +21,4 @@ public class TagConfiguration : IEntityTypeConfiguration<TagModel>
builder.HasKey(tag => tag.Name);
builder.Property(tag => tag.Name).IsRequired().HasMaxLength(50);
}
#endregion
}
@@ -19,7 +19,6 @@ namespace Lumina.DataAccess.Common.DependencyInjection;
/// </summary>
public static class DataAccessLayerServices
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Extension method for adding the DataAccess layer services to the DI container.
/// </summary>
@@ -57,5 +56,4 @@ public static class DataAccessLayerServices
.First(), type);
}
}
#endregion
}
@@ -19,11 +19,8 @@ namespace Lumina.DataAccess.Core.Repositories.Books;
/// </summary>
internal sealed class BookRepository : IBookRepository
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly LuminaDbContext _luminaDbContext;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="BookRepository"/> class.
/// </summary>
@@ -32,9 +29,7 @@ internal sealed class BookRepository : IBookRepository
{
_luminaDbContext = luminaDbContext;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Adds a new book.
/// </summary>
@@ -77,5 +72,4 @@ internal sealed class BookRepository : IBookRepository
.Include(book => book.ISBNs)
.ToListAsync(cancellationToken).ConfigureAwait(false);
}
#endregion
}
@@ -5,12 +5,10 @@
/// </summary>
public interface IRepositoryFactory
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a new repository of type <typeparamref name="TResult"/>.
/// </summary>
/// <typeparam name="TResult">The type of repository to create.</typeparam>
/// <returns>A repository of type <typeparamref name="TResult"/>.</returns>
TResult CreateRepository<TResult>() where TResult : notnull;
#endregion
}
@@ -12,18 +12,13 @@ namespace Lumina.DataAccess.Core.Repositories.Common.Factory;
/// </summary>
public class RepositoryDictionary
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly List<KeyValuePair<Type, object>> _container = [];
#endregion
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the number of added repositories.
/// </summary>
public int Count => _container.Count;
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Resets the collection of repositories.
/// </summary>
@@ -66,5 +61,4 @@ public class RepositoryDictionary
{
return (TResult)_container.FirstOrDefault(e => e.Key == key).Value;
}
#endregion
}
@@ -10,11 +10,8 @@ namespace Lumina.DataAccess.Core.Repositories.Common.Factory;
/// </summary>
public class RepositoryFactory : IRepositoryFactory
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IServiceProvider _serviceProvider;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="RepositoryFactory"/> class.
/// </summary>
@@ -23,9 +20,7 @@ public class RepositoryFactory : IRepositoryFactory
{
_serviceProvider = serviceProvider;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a new repository of type <typeparamref name="TResult"/>.
/// </summary>
@@ -36,5 +31,4 @@ public class RepositoryFactory : IRepositoryFactory
{
return _serviceProvider.GetRequiredService<TResult>() ?? throw new ArgumentException();
}
#endregion
}
@@ -18,11 +18,8 @@ namespace Lumina.DataAccess.Core.UoW;
/// <remarks>To update the database: update-database -p Lumina.DataAccess -s Lumina.Presentation.Api</remarks>
public class LuminaDbContext : DbContext
{
#region ==================================================================== PROPERTIES =================================================================================
public virtual DbSet<BookModel> Books { get; set; } = null!;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="LuminaDbContext"/> class.
/// </summary>
@@ -30,9 +27,7 @@ public class LuminaDbContext : DbContext
public LuminaDbContext(DbContextOptions<LuminaDbContext> options) : base(options)
{
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Configures the entity mappings for the database context.
/// </summary>
@@ -67,5 +62,4 @@ public class LuminaDbContext : DbContext
}
return base.SaveChanges();
}
#endregion
}
@@ -17,19 +17,14 @@ namespace Lumina.DataAccess.Core.UoW;
/// </summary>
public class UnitOfWork : IUnitOfWork
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly LuminaDbContext _luminaDbContext;
private readonly IRepositoryFactory _repositoryFactory;
#endregion
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets or sets the collection of available repositories.
/// </summary>
internal RepositoryDictionary Repositories { get; private set; } = new RepositoryDictionary();
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="UnitOfWork"/> class.
/// </summary>
@@ -41,9 +36,7 @@ public class UnitOfWork : IUnitOfWork
_luminaDbContext = luminaDbContext;
AddRepositories();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Adds all the repositories from the Data Access Layer so that they can be exposed to the Business Layer.
/// </summary>
@@ -121,5 +114,4 @@ public class UnitOfWork : IUnitOfWork
{
throw new NotImplementedException();
}
#endregion
}