mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
resolve CA1062 warnings, rm Jetbrains.Annotations from Data proj
This commit is contained in:
parent
2b7e56df2f
commit
1198ca56d4
27 changed files with 297 additions and 272 deletions
|
|
@ -5,7 +5,7 @@ namespace FilterLists.Data.Entities
|
|||
public abstract class BaseEntity : IBaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime? CreatedDateUtc { get; set; }
|
||||
public DateTime? ModifiedDateUtc { get; set; }
|
||||
public DateTime? CreatedDateUtc { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FilterList : BaseEntity
|
||||
{
|
||||
public string ChatUrl { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class Language : BaseEntity
|
||||
{
|
||||
public ICollection<FilterListLanguage> FilterListLanguages { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class License : BaseEntity
|
||||
{
|
||||
public string DescriptionUrl { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class Maintainer : BaseEntity
|
||||
{
|
||||
public string EmailAddress { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class Software : BaseEntity
|
||||
{
|
||||
public string DownloadUrl { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class Syntax : BaseEntity
|
||||
{
|
||||
public string DefinitionUrl { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using FilterLists.Data.Seed.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
|
@ -7,22 +8,23 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class BaseEntityTypeConfiguration<TEntity> : IEntityTypeConfiguration<TEntity> where TEntity : BaseEntity
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<TEntity> entityTypeBuilder)
|
||||
public virtual void Configure(EntityTypeBuilder<TEntity> builder)
|
||||
{
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.UseMySqlIdentityColumn()
|
||||
.HasColumnType("SMALLINT");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp()");
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
|
||||
entityTypeBuilder.HasDataJsonFile<TEntity>();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
builder.Property(x => x.Id)
|
||||
.UseMySqlIdentityColumn()
|
||||
.HasColumnType("SMALLINT");
|
||||
builder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp()");
|
||||
builder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
|
||||
builder.HasDataJsonFile<TEntity>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,48 +7,49 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class FilterListTypeConfiguration : BaseEntityTypeConfiguration<FilterList>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<FilterList> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("filterlists");
|
||||
entityTypeBuilder.Property(x => x.ChatUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.Description)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.DescriptionSourceUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.DonateUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.EmailAddress)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.ForumUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.IssuesUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.LicenseId)
|
||||
.HasDefaultValue(5);
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
entityTypeBuilder.Property(x => x.PolicyUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.PublishedDate)
|
||||
.HasColumnType("DATETIME")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.SubmissionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.UpdatedDate)
|
||||
.HasColumnType("DATETIME")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.ViewUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.ViewUrlMirror1)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.ViewUrlMirror2)
|
||||
.HasColumnType("TEXT");
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("filterlists");
|
||||
builder.Property(x => x.ChatUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.Description)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.DescriptionSourceUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.DonateUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.EmailAddress)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.ForumUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.IssuesUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.LicenseId)
|
||||
.HasDefaultValue(5);
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
builder.Property(x => x.PolicyUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.PublishedDate)
|
||||
.HasColumnType("DATETIME")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.SubmissionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.UpdatedDate)
|
||||
.HasColumnType("DATETIME")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.ViewUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.ViewUrlMirror1)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.ViewUrlMirror2)
|
||||
.HasColumnType("TEXT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using FilterLists.Data.Seed.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
|
@ -8,14 +9,15 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
public class BaseJunctionTypeConfiguration<TJunction> : IEntityTypeConfiguration<TJunction>
|
||||
where TJunction : BaseJunctionEntity
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<TJunction> entityTypeBuilder)
|
||||
public virtual void Configure(EntityTypeBuilder<TJunction> builder)
|
||||
{
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp()");
|
||||
entityTypeBuilder.HasDataJsonFile<TJunction>();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
builder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd()
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("current_timestamp()");
|
||||
builder.HasDataJsonFile<TJunction>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class DependentTypeConfiguration : BaseJunctionTypeConfiguration<Dependent>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Dependent> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Dependent> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("dependents");
|
||||
entityTypeBuilder.HasKey(x => new {x.DependentFilterListId, x.DependencyFilterListId});
|
||||
entityTypeBuilder.HasOne(x => x.DependentFilterList)
|
||||
.WithMany(x => x.DependentFilterLists)
|
||||
.HasForeignKey(x => x.DependentFilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.DependencyFilterList)
|
||||
.WithMany(x => x.DependencyFilterLists)
|
||||
.HasForeignKey(x => x.DependencyFilterListId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("dependents");
|
||||
builder.HasKey(x => new {x.DependentFilterListId, x.DependencyFilterListId});
|
||||
builder.HasOne(x => x.DependentFilterList)
|
||||
.WithMany(x => x.DependentFilterLists)
|
||||
.HasForeignKey(x => x.DependentFilterListId);
|
||||
builder.HasOne(x => x.DependencyFilterList)
|
||||
.WithMany(x => x.DependencyFilterLists)
|
||||
.HasForeignKey(x => x.DependencyFilterListId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class FilterListLanguageTypeConfiguration : BaseJunctionTypeConfiguration<FilterListLanguage>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListLanguage> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<FilterListLanguage> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("filterlists_languages");
|
||||
entityTypeBuilder.HasKey(x => new {x.FilterListId, x.LanguageId});
|
||||
entityTypeBuilder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListLanguages)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.Language)
|
||||
.WithMany(x => x.FilterListLanguages)
|
||||
.HasForeignKey(x => x.LanguageId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("filterlists_languages");
|
||||
builder.HasKey(x => new {x.FilterListId, x.LanguageId});
|
||||
builder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListLanguages)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
builder.HasOne(x => x.Language)
|
||||
.WithMany(x => x.FilterListLanguages)
|
||||
.HasForeignKey(x => x.LanguageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class FilterListMaintainerTypeConfiguration : BaseJunctionTypeConfiguration<FilterListMaintainer>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListMaintainer> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<FilterListMaintainer> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("filterlists_maintainers");
|
||||
entityTypeBuilder.HasKey(x => new {x.FilterListId, x.MaintainerId});
|
||||
entityTypeBuilder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListMaintainers)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.Maintainer)
|
||||
.WithMany(x => x.FilterListMaintainers)
|
||||
.HasForeignKey(x => x.MaintainerId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("filterlists_maintainers");
|
||||
builder.HasKey(x => new {x.FilterListId, x.MaintainerId});
|
||||
builder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListMaintainers)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
builder.HasOne(x => x.Maintainer)
|
||||
.WithMany(x => x.FilterListMaintainers)
|
||||
.HasForeignKey(x => x.MaintainerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class FilterListTagTypeConfiguration : BaseJunctionTypeConfiguration<FilterListTag>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListTag> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<FilterListTag> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("filterlists_tags");
|
||||
entityTypeBuilder.HasKey(x => new {x.FilterListId, x.TagId});
|
||||
entityTypeBuilder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListTags)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.Tag)
|
||||
.WithMany(x => x.FilterListTags)
|
||||
.HasForeignKey(x => x.TagId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("filterlists_tags");
|
||||
builder.HasKey(x => new {x.FilterListId, x.TagId});
|
||||
builder.HasOne(x => x.FilterList)
|
||||
.WithMany(x => x.FilterListTags)
|
||||
.HasForeignKey(x => x.FilterListId);
|
||||
builder.HasOne(x => x.Tag)
|
||||
.WithMany(x => x.FilterListTags)
|
||||
.HasForeignKey(x => x.TagId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class ForkTypeConfiguration : BaseJunctionTypeConfiguration<Fork>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Fork> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Fork> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("forks");
|
||||
entityTypeBuilder.HasKey(x => new {x.ForkFilterListId, x.UpstreamFilterListId});
|
||||
entityTypeBuilder.HasOne(x => x.ForkFilterList)
|
||||
.WithMany(x => x.ForkFilterLists)
|
||||
.HasForeignKey(x => x.ForkFilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.UpstreamFilterList)
|
||||
.WithMany(x => x.UpstreamForkFilterLists)
|
||||
.HasForeignKey(x => x.UpstreamFilterListId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("forks");
|
||||
builder.HasKey(x => new {x.ForkFilterListId, x.UpstreamFilterListId});
|
||||
builder.HasOne(x => x.ForkFilterList)
|
||||
.WithMany(x => x.ForkFilterLists)
|
||||
.HasForeignKey(x => x.ForkFilterListId);
|
||||
builder.HasOne(x => x.UpstreamFilterList)
|
||||
.WithMany(x => x.UpstreamForkFilterLists)
|
||||
.HasForeignKey(x => x.UpstreamFilterListId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class MergeTypeConfiguration : BaseJunctionTypeConfiguration<Merge>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Merge> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Merge> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("merges");
|
||||
entityTypeBuilder.HasKey(x => new {x.MergeFilterListId, x.UpstreamFilterListId});
|
||||
entityTypeBuilder.HasOne(x => x.MergeFilterList)
|
||||
.WithMany(x => x.MergeFilterLists)
|
||||
.HasForeignKey(x => x.MergeFilterListId);
|
||||
entityTypeBuilder.HasOne(x => x.UpstreamFilterList)
|
||||
.WithMany(x => x.UpstreamMergeFilterLists)
|
||||
.HasForeignKey(x => x.UpstreamFilterListId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("merges");
|
||||
builder.HasKey(x => new {x.MergeFilterListId, x.UpstreamFilterListId});
|
||||
builder.HasOne(x => x.MergeFilterList)
|
||||
.WithMany(x => x.MergeFilterLists)
|
||||
.HasForeignKey(x => x.MergeFilterListId);
|
||||
builder.HasOne(x => x.UpstreamFilterList)
|
||||
.WithMany(x => x.UpstreamMergeFilterLists)
|
||||
.HasForeignKey(x => x.UpstreamFilterListId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,18 +7,19 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class SnapshotRuleTypeConfiguration : BaseJunctionTypeConfiguration<SnapshotRule>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<SnapshotRule> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<SnapshotRule> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("snapshots_rules");
|
||||
entityTypeBuilder.HasKey(x => new {x.SnapshotId, x.RuleId});
|
||||
entityTypeBuilder.Ignore(x => x.CreatedDateUtc);
|
||||
entityTypeBuilder.HasOne(x => x.Snapshot)
|
||||
.WithMany(x => x.SnapshotRules)
|
||||
.HasForeignKey(x => x.SnapshotId);
|
||||
entityTypeBuilder.HasOne(x => x.Rule)
|
||||
.WithMany(x => x.SnapshotRules)
|
||||
.HasForeignKey(x => x.RuleId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("snapshots_rules");
|
||||
builder.HasKey(x => new {x.SnapshotId, x.RuleId});
|
||||
builder.Ignore(x => x.CreatedDateUtc);
|
||||
builder.HasOne(x => x.Snapshot)
|
||||
.WithMany(x => x.SnapshotRules)
|
||||
.HasForeignKey(x => x.SnapshotId);
|
||||
builder.HasOne(x => x.Rule)
|
||||
.WithMany(x => x.SnapshotRules)
|
||||
.HasForeignKey(x => x.RuleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities.Junctions;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
|||
{
|
||||
public class SoftwareSyntaxTypeConfiguration : BaseJunctionTypeConfiguration<SoftwareSyntax>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<SoftwareSyntax> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<SoftwareSyntax> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("software_syntaxes");
|
||||
entityTypeBuilder.HasKey(x => new {x.SyntaxId, x.SoftwareId});
|
||||
entityTypeBuilder.HasOne(x => x.Software)
|
||||
.WithMany(x => x.SoftwareSyntaxes)
|
||||
.HasForeignKey(x => x.SoftwareId);
|
||||
entityTypeBuilder.HasOne(x => x.Syntax)
|
||||
.WithMany(x => x.SoftwareSyntaxes)
|
||||
.HasForeignKey(x => x.SyntaxId);
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("software_syntaxes");
|
||||
builder.HasKey(x => new {x.SyntaxId, x.SoftwareId});
|
||||
builder.HasOne(x => x.Software)
|
||||
.WithMany(x => x.SoftwareSyntaxes)
|
||||
.HasForeignKey(x => x.SoftwareId);
|
||||
builder.HasOne(x => x.Syntax)
|
||||
.WithMany(x => x.SoftwareSyntaxes)
|
||||
.HasForeignKey(x => x.SyntaxId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,31 +7,32 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class LanguageTypeConfiguration : BaseEntityTypeConfiguration<Language>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Language> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Language> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("languages");
|
||||
entityTypeBuilder.Property(x => x.Iso6391)
|
||||
.HasColumnType("VARCHAR(2)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Iso6392)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Iso6392B)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Iso6392T)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Iso6393)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.LocalName)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("languages");
|
||||
builder.Property(x => x.Iso6391)
|
||||
.HasColumnType("VARCHAR(2)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Iso6392)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Iso6392B)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Iso6392T)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Iso6393)
|
||||
.HasColumnType("VARCHAR(3)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.LocalName)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,15 +7,16 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class LicenseTypeConfiguration : BaseEntityTypeConfiguration<License>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<License> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<License> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("licenses");
|
||||
entityTypeBuilder.Property(x => x.DescriptionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("licenses");
|
||||
builder.Property(x => x.DescriptionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,21 +7,22 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class MaintainerTypeConfiguration : BaseEntityTypeConfiguration<Maintainer>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Maintainer> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Maintainer> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("maintainers");
|
||||
entityTypeBuilder.Property(x => x.EmailAddress)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
entityTypeBuilder.Property(x => x.TwitterHandle)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("maintainers");
|
||||
builder.Property(x => x.EmailAddress)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
builder.Property(x => x.TwitterHandle)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.HasDefaultValueSql("NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,16 +7,17 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class RuleTypeConfiguration : BaseEntityTypeConfiguration<Rule>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Rule> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Rule> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("rules");
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("INT");
|
||||
entityTypeBuilder.Ignore(x => x.ModifiedDateUtc);
|
||||
entityTypeBuilder.Property(x => x.Raw)
|
||||
.HasColumnType("LONGTEXT")
|
||||
.IsRequired();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("rules");
|
||||
builder.Property(x => x.Id)
|
||||
.HasColumnType("INT");
|
||||
builder.Ignore(x => x.ModifiedDateUtc);
|
||||
builder.Property(x => x.Raw)
|
||||
.HasColumnType("LONGTEXT")
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,21 +7,22 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class SnapshotTypeConfiguration : BaseEntityTypeConfiguration<Snapshot>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Snapshot> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Snapshot> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("snapshots");
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("MEDIUMINT");
|
||||
entityTypeBuilder.Property(x => x.HttpStatusCode)
|
||||
.HasColumnType("SMALLINT")
|
||||
.HasDefaultValueSql("NULL");
|
||||
entityTypeBuilder.Property(x => x.Md5Checksum)
|
||||
.HasColumnType("BINARY(16)");
|
||||
entityTypeBuilder.Property(x => x.WaybackTimestamp)
|
||||
.HasColumnType("TIMESTAMP");
|
||||
entityTypeBuilder.Property(x => x.WaybackUrl)
|
||||
.HasColumnType("TEXT");
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("snapshots");
|
||||
builder.Property(x => x.Id)
|
||||
.HasColumnType("MEDIUMINT");
|
||||
builder.Property(x => x.HttpStatusCode)
|
||||
.HasColumnType("SMALLINT")
|
||||
.HasDefaultValueSql("NULL");
|
||||
builder.Property(x => x.Md5Checksum)
|
||||
.HasColumnType("BINARY(16)");
|
||||
builder.Property(x => x.WaybackTimestamp)
|
||||
.HasColumnType("TIMESTAMP");
|
||||
builder.Property(x => x.WaybackUrl)
|
||||
.HasColumnType("TEXT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,17 +7,18 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class SoftwareTypeConfiguration : BaseEntityTypeConfiguration<Software>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Software> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Software> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("software");
|
||||
entityTypeBuilder.Property(x => x.DownloadUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("software");
|
||||
builder.Property(x => x.DownloadUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.HomeUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,15 +7,16 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class SyntaxTypeConfiguration : BaseEntityTypeConfiguration<Syntax>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Syntax> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Syntax> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("syntaxes");
|
||||
entityTypeBuilder.Property(x => x.DefinitionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("syntaxes");
|
||||
builder.Property(x => x.DefinitionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Ardalis.GuardClauses;
|
||||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
|
|
@ -6,15 +7,16 @@ namespace FilterLists.Data.EntityTypeConfigurations
|
|||
{
|
||||
public class TagTypeConfiguration : BaseEntityTypeConfiguration<Tag>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Tag> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Tag> builder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
entityTypeBuilder.ToTable("tags");
|
||||
entityTypeBuilder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
entityTypeBuilder.Property(x => x.Description)
|
||||
.HasColumnType("TEXT");
|
||||
Guard.Against.Null(builder, nameof(builder));
|
||||
base.Configure(builder);
|
||||
builder.ToTable("tags");
|
||||
builder.Property(x => x.Name)
|
||||
.HasColumnType("VARCHAR(126)")
|
||||
.IsRequired();
|
||||
builder.Property(x => x.Description)
|
||||
.HasColumnType("TEXT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Ardalis.GuardClauses" Version="1.4.1" />
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
|
|||
Loading…
Reference in a new issue