mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(dir): ✨ enable EF Core lazy loading for aggregate-to-aggregate r'ships
This commit is contained in:
parent
6de36cfdca
commit
b718fdde8b
6 changed files with 13 additions and 11 deletions
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace FilterLists.Directory.Domain.Aggregates.Changes;
|
||||
|
||||
public sealed class FilterListChange : Change, IChangeAggregate<FilterListRecord>
|
||||
public class FilterListChange : Change, IChangeAggregate<FilterListRecord>
|
||||
{
|
||||
private FilterListChange() { }
|
||||
protected FilterListChange() { }
|
||||
|
||||
public FilterListRecord? Before { get; private init; }
|
||||
public FilterListRecord? After { get; private init; }
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
namespace FilterLists.Directory.Domain.Aggregates.FilterLists;
|
||||
|
||||
public sealed class FilterList : IRequireChangeApproval<FilterListChange>
|
||||
public class FilterList : IRequireChangeApproval<FilterListChange>
|
||||
{
|
||||
private ICollection<FilterListChange> _changes = new HashSet<FilterListChange>();
|
||||
|
||||
private FilterList() { }
|
||||
protected FilterList() { }
|
||||
|
||||
public string Name { get; private init; } = null!;
|
||||
public string? Description { get; private init; }
|
||||
public License License { get; private init; } = null!;
|
||||
public virtual License License { get; private init; } = null!;
|
||||
public Uri? HomeUrl { get; private init; }
|
||||
public Uri? OnionUrl { get; private init; }
|
||||
public Uri? PolicyUrl { get; private init; }
|
||||
|
|
@ -21,8 +21,8 @@ private FilterList() { }
|
|||
public Uri? ChatUrl { get; private init; }
|
||||
public string? EmailAddress { get; private init; }
|
||||
public Uri? DonateUrl { get; private init; }
|
||||
public IReadOnlyCollection<FilterListViewUrl> ViewUrls { get; private init; } = new HashSet<FilterListViewUrl>();
|
||||
public IReadOnlyCollection<FilterListChange> Changes => (IReadOnlyCollection<FilterListChange>)_changes;
|
||||
public virtual IReadOnlyCollection<FilterListViewUrl> ViewUrls { get; private init; } = new HashSet<FilterListViewUrl>();
|
||||
public virtual IReadOnlyCollection<FilterListChange> Changes => (IReadOnlyCollection<FilterListChange>)_changes;
|
||||
|
||||
public static FilterList Create(
|
||||
string name,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
namespace FilterLists.Directory.Domain.Aggregates.FilterLists;
|
||||
|
||||
public sealed class FilterListViewUrl
|
||||
public class FilterListViewUrl
|
||||
{
|
||||
private FilterListViewUrl() { }
|
||||
protected FilterListViewUrl() { }
|
||||
|
||||
public short SegmentNumber { get; private init; }
|
||||
public short Primariness { get; private init; }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
namespace FilterLists.Directory.Domain.Aggregates.Licenses;
|
||||
|
||||
public sealed class License
|
||||
public class License
|
||||
{
|
||||
private License() { }
|
||||
protected License() { }
|
||||
|
||||
public string Name { get; private init; } = null!;
|
||||
public Uri? Url { get; private init; }
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public static void AddInfrastructure(this IServiceCollection services, IConfigur
|
|||
{
|
||||
o.UseNpgsql(configuration.GetConnectionString("DirectoryConnection"))
|
||||
.UseSnakeCaseNamingConvention()
|
||||
.UseLazyLoadingProxies()
|
||||
#if DEBUG
|
||||
.LogTo(Console.WriteLine, LogLevel.Information);
|
||||
o.EnableSensitiveDataLogging();
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue