Move model names to singular.

This commit is contained in:
2018-08-06 21:27:14 +01:00
parent 728eb83d6b
commit 7446bd856d
35 changed files with 1969 additions and 238 deletions

View File

@@ -1,6 +1,6 @@
namespace Cicm.Database.Models
{
public class Admins
public class Admin
{
public int Id { get; set; }
public string User { get; set; }

View File

@@ -1,6 +1,6 @@
namespace Cicm.Database.Models
{
public class BrowserTests
public class BrowserTest
{
public int Id { get; set; }
public string UserAgent { get; set; }

View File

@@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class Companies
{
public Companies()
{
CompanyLogos = new HashSet<CompanyLogos>();
Gpus = new HashSet<Gpus>();
InverseSoldToNavigation = new HashSet<Companies>();
MachineFamilies = new HashSet<MachineFamilies>();
Machines = new HashSet<Machines>();
Processors = new HashSet<Processors>();
SoundSynths = new HashSet<SoundSynths>();
}
public int Id { get; set; }
public string Name { get; set; }
public DateTime? Founded { get; set; }
public string Website { get; set; }
public string Twitter { get; set; }
public string Facebook { get; set; }
public DateTime? Sold { get; set; }
public int? SoldToId { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Province { get; set; }
public string PostalCode { get; set; }
public short? CountryId { get; set; }
public CompanyStatus Status { get; set; }
public Iso31661Numeric Country { get; set; }
public Companies SoldTo { get; set; }
public CompanyDescriptions Description { get; set; }
public ICollection<CompanyLogos> CompanyLogos { get; set; }
public ICollection<Gpus> Gpus { get; set; }
public ICollection<Companies> InverseSoldToNavigation { get; set; }
public ICollection<MachineFamilies> MachineFamilies { get; set; }
public ICollection<Machines> Machines { get; set; }
public ICollection<Processors> Processors { get; set; }
public ICollection<SoundSynths> SoundSynths { get; set; }
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class Company
{
public Company()
{
CompanyLogos = new HashSet<CompanyLogo>();
Gpus = new HashSet<Gpu>();
InverseSoldToNavigation = new HashSet<Company>();
MachineFamilies = new HashSet<MachineFamily>();
Machines = new HashSet<Machine>();
Processors = new HashSet<Processor>();
SoundSynths = new HashSet<SoundSynth>();
}
public int Id { get; set; }
public string Name { get; set; }
public DateTime? Founded { get; set; }
public string Website { get; set; }
public string Twitter { get; set; }
public string Facebook { get; set; }
public DateTime? Sold { get; set; }
public int? SoldToId { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Province { get; set; }
public string PostalCode { get; set; }
public short? CountryId { get; set; }
public CompanyStatus Status { get; set; }
public Iso31661Numeric Country { get; set; }
public Company SoldTo { get; set; }
public CompanyDescription Description { get; set; }
public ICollection<CompanyLogo> CompanyLogos { get; set; }
public ICollection<Gpu> Gpus { get; set; }
public ICollection<Company> InverseSoldToNavigation { get; set; }
public ICollection<MachineFamily> MachineFamilies { get; set; }
public ICollection<Machine> Machines { get; set; }
public ICollection<Processor> Processors { get; set; }
public ICollection<SoundSynth> SoundSynths { get; set; }
}
}

View File

@@ -1,11 +1,11 @@
namespace Cicm.Database.Models
{
public class CompanyDescriptions
public class CompanyDescription
{
public int Id { get; set; }
public int CompanyId { get; set; }
public string Text { get; set; }
public Companies Company { get; set; }
public Company Company { get; set; }
}
}

View File

@@ -1,12 +1,12 @@
namespace Cicm.Database.Models
{
public class CompanyLogos
public class CompanyLogo
{
public int Id { get; set; }
public int CompanyId { get; set; }
public int? Year { get; set; }
public string Guid { get; set; }
public Companies Company { get; set; }
public Company Company { get; set; }
}
}

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class Gpus
public class Gpu
{
public Gpus()
public Gpu()
{
GpusByMachine = new HashSet<GpusByMachine>();
ResolutionsByGpu = new HashSet<ResolutionsByGpu>();
@@ -22,7 +22,7 @@ namespace Cicm.Database.Models
public float? DieSize { get; set; }
public long? Transistors { get; set; }
public Companies Company { get; set; }
public Company Company { get; set; }
public ICollection<GpusByMachine> GpusByMachine { get; set; }
public ICollection<ResolutionsByGpu> ResolutionsByGpu { get; set; }
}

View File

@@ -6,7 +6,7 @@
public int MachineId { get; set; }
public long Id { get; set; }
public Gpus Gpu { get; set; }
public Machines Machine { get; set; }
public Gpu Gpu { get; set; }
public Machine Machine { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class InstructionSet
{
public InstructionSet()
{
Processors = new HashSet<Processor>();
}
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Processor> Processors { get; set; }
}
}

View File

@@ -2,9 +2,9 @@
namespace Cicm.Database.Models
{
public class InstructionSetExtensions
public class InstructionSetExtension
{
public InstructionSetExtensions()
public InstructionSetExtension()
{
InstructionSetExtensionsByProcessor = new HashSet<InstructionSetExtensionsByProcessor>();
}

View File

@@ -6,7 +6,7 @@
public int ProcessorId { get; set; }
public int ExtensionId { get; set; }
public InstructionSetExtensions Extension { get; set; }
public Processors Processor { get; set; }
public InstructionSetExtension Extension { get; set; }
public Processor Processor { get; set; }
}
}

View File

@@ -1,17 +0,0 @@
using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class InstructionSets
{
public InstructionSets()
{
Processors = new HashSet<Processors>();
}
public int Id { get; set; }
public string InstructionSet { get; set; }
public ICollection<Processors> Processors { get; set; }
}
}

View File

@@ -6,12 +6,12 @@ namespace Cicm.Database.Models
{
public Iso31661Numeric()
{
Companies = new HashSet<Companies>();
Companies = new HashSet<Company>();
}
public short Id { get; set; }
public string Name { get; set; }
public ICollection<Companies> Companies { get; set; }
public ICollection<Company> Companies { get; set; }
}
}

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class Machines
public class Machine
{
public Machines()
public Machine()
{
Gpus = new HashSet<GpusByMachine>();
Memory = new HashSet<MemoryByMachine>();
@@ -22,8 +22,8 @@ namespace Cicm.Database.Models
public int? FamilyId { get; set; }
public string Model { get; set; }
public Companies Company { get; set; }
public MachineFamilies Family { get; set; }
public Company Company { get; set; }
public MachineFamily Family { get; set; }
public ICollection<GpusByMachine> Gpus { get; set; }
public ICollection<MemoryByMachine> Memory { get; set; }
public ICollection<ProcessorsByMachine> Processors { get; set; }

View File

@@ -2,18 +2,18 @@
namespace Cicm.Database.Models
{
public class MachineFamilies
public class MachineFamily
{
public MachineFamilies()
public MachineFamily()
{
Machines = new HashSet<Machines>();
Machines = new HashSet<Machine>();
}
public int Id { get; set; }
public int CompanyId { get; set; }
public string Name { get; set; }
public Companies Company { get; set; }
public ICollection<Machines> Machines { get; set; }
public Company Company { get; set; }
public ICollection<Machine> Machines { get; set; }
}
}

View File

@@ -9,6 +9,6 @@
public double? Speed { get; set; }
public long Id { get; set; }
public Machines Machine { get; set; }
public Machine Machine { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace Cicm.Database.Models
{
public class MoneyDonations
public class MoneyDonation
{
public int Id { get; set; }
public string Donator { get; set; }

View File

@@ -1,6 +1,6 @@
namespace Cicm.Database.Models
{
public class OwnedComputers
public class OwnedComputer
{
public int Id { get; set; }
public int DbId { get; set; }

View File

@@ -1,6 +1,6 @@
namespace Cicm.Database.Models
{
public class OwnedConsoles
public class OwnedConsole
{
public int Id { get; set; }
public int DbId { get; set; }

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class Processors
public class Processor
{
public Processors()
public Processor()
{
InstructionSetExtensions = new HashSet<InstructionSetExtensionsByProcessor>();
ProcessorsByMachine = new HashSet<ProcessorsByMachine>();
@@ -38,8 +38,8 @@ namespace Cicm.Database.Models
public float? L2 { get; set; }
public float? L3 { get; set; }
public Companies Company { get; set; }
public InstructionSets InstructionSet { get; set; }
public Company Company { get; set; }
public InstructionSet InstructionSet { get; set; }
public ICollection<InstructionSetExtensionsByProcessor> InstructionSetExtensions { get; set; }
public ICollection<ProcessorsByMachine> ProcessorsByMachine { get; set; }
}

View File

@@ -7,7 +7,7 @@
public float? Speed { get; set; }
public long Id { get; set; }
public Machines Machine { get; set; }
public Processors Processor { get; set; }
public Machine Machine { get; set; }
public Processor Processor { get; set; }
}
}

View File

@@ -2,9 +2,9 @@
namespace Cicm.Database.Models
{
public class Resolutions
public class Resolution
{
public Resolutions()
public Resolution()
{
ResolutionsByGpu = new HashSet<ResolutionsByGpu>();
}

View File

@@ -6,7 +6,7 @@
public int ResolutionId { get; set; }
public long Id { get; set; }
public Gpus Gpu { get; set; }
public Resolutions Resolution { get; set; }
public Gpu Gpu { get; set; }
public Resolution Resolution { get; set; }
}
}

View File

@@ -6,7 +6,7 @@
public int MachineId { get; set; }
public long Id { get; set; }
public Machines Machine { get; set; }
public SoundSynths SoundSynth { get; set; }
public Machine Machine { get; set; }
public SoundSynth SoundSynth { get; set; }
}
}

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
namespace Cicm.Database.Models
{
public class SoundSynths
public class SoundSynth
{
public SoundSynths()
public SoundSynth()
{
SoundByMachine = new HashSet<SoundByMachine>();
}
@@ -22,7 +22,7 @@ namespace Cicm.Database.Models
public int? WhiteNoise { get; set; }
public int? Type { get; set; }
public Companies Company { get; set; }
public Company Company { get; set; }
public ICollection<SoundByMachine> SoundByMachine { get; set; }
}
}

View File

@@ -8,6 +8,6 @@
public long? Capacity { get; set; }
public long Id { get; set; }
public Machines Machine { get; set; }
public Machine Machine { get; set; }
}
}

View File

@@ -8,33 +8,33 @@ namespace Cicm.Database.Models
public cicmContext(DbContextOptions<cicmContext> options) : base(options) { }
public virtual DbSet<Admins> Admins { get; set; }
public virtual DbSet<BrowserTests> BrowserTests { get; set; }
public virtual DbSet<Admin> Admins { get; set; }
public virtual DbSet<BrowserTest> BrowserTests { get; set; }
public virtual DbSet<CicmDb> CicmDb { get; set; }
public virtual DbSet<Companies> Companies { get; set; }
public virtual DbSet<CompanyDescriptions> CompanyDescriptions { get; set; }
public virtual DbSet<CompanyLogos> CompanyLogos { get; set; }
public virtual DbSet<Company> Companies { get; set; }
public virtual DbSet<CompanyDescription> CompanyDescriptions { get; set; }
public virtual DbSet<CompanyLogo> CompanyLogos { get; set; }
public virtual DbSet<Forbidden> Forbidden { get; set; }
public virtual DbSet<Gpus> Gpus { get; set; }
public virtual DbSet<Gpu> Gpus { get; set; }
public virtual DbSet<GpusByMachine> GpusByMachine { get; set; }
public virtual DbSet<InstructionSetExtensions> InstructionSetExtensions { get; set; }
public virtual DbSet<InstructionSetExtension> InstructionSetExtensions { get; set; }
public virtual DbSet<InstructionSetExtensionsByProcessor> InstructionSetExtensionsByProcessor { get; set; }
public virtual DbSet<InstructionSets> InstructionSets { get; set; }
public virtual DbSet<InstructionSet> InstructionSets { get; set; }
public virtual DbSet<Iso31661Numeric> Iso31661Numeric { get; set; }
public virtual DbSet<Log> Log { get; set; }
public virtual DbSet<MachineFamilies> MachineFamilies { get; set; }
public virtual DbSet<Machines> Machines { get; set; }
public virtual DbSet<MachineFamily> MachineFamilies { get; set; }
public virtual DbSet<Machine> Machines { get; set; }
public virtual DbSet<MemoryByMachine> MemoryByMachine { get; set; }
public virtual DbSet<MoneyDonations> MoneyDonations { get; set; }
public virtual DbSet<MoneyDonation> MoneyDonations { get; set; }
public virtual DbSet<News> News { get; set; }
public virtual DbSet<OwnedComputers> OwnedComputers { get; set; }
public virtual DbSet<OwnedConsoles> OwnedConsoles { get; set; }
public virtual DbSet<Processors> Processors { get; set; }
public virtual DbSet<OwnedComputer> OwnedComputers { get; set; }
public virtual DbSet<OwnedConsole> OwnedConsoles { get; set; }
public virtual DbSet<Processor> Processors { get; set; }
public virtual DbSet<ProcessorsByMachine> ProcessorsByMachine { get; set; }
public virtual DbSet<Resolutions> Resolutions { get; set; }
public virtual DbSet<Resolution> Resolutions { get; set; }
public virtual DbSet<ResolutionsByGpu> ResolutionsByGpu { get; set; }
public virtual DbSet<SoundByMachine> SoundByMachine { get; set; }
public virtual DbSet<SoundSynths> SoundSynths { get; set; }
public virtual DbSet<SoundSynth> SoundSynths { get; set; }
public virtual DbSet<StorageByMachine> StorageByMachine { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
@@ -48,7 +48,7 @@ namespace Cicm.Database.Models
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Admins>(entity =>
modelBuilder.Entity<Admin>(entity =>
{
entity.ToTable("admins");
@@ -63,7 +63,7 @@ namespace Cicm.Database.Models
.HasDefaultValueSql("''");
});
modelBuilder.Entity<BrowserTests>(entity =>
modelBuilder.Entity<BrowserTest>(entity =>
{
entity.ToTable("browser_tests");
@@ -138,7 +138,7 @@ namespace Cicm.Database.Models
entity.Property(e => e.Version).HasColumnName("version").HasColumnType("int(11)");
});
modelBuilder.Entity<Companies>(entity =>
modelBuilder.Entity<Company>(entity =>
{
entity.ToTable("companies");
@@ -204,7 +204,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_companies_sold_to");
});
modelBuilder.Entity<CompanyDescriptions>(entity =>
modelBuilder.Entity<CompanyDescription>(entity =>
{
entity.ToTable("company_descriptions");
@@ -218,11 +218,11 @@ namespace Cicm.Database.Models
entity.Property(e => e.Text).HasColumnName("text").HasColumnType("text");
entity.HasOne(d => d.Company).WithOne(p => p.Description).HasForeignKey<CompanyDescriptions>(d => d.Id)
entity.HasOne(d => d.Company).WithOne(p => p.Description).HasForeignKey<CompanyDescription>(d => d.Id)
.HasConstraintName("fk_company_id");
});
modelBuilder.Entity<CompanyLogos>(entity =>
modelBuilder.Entity<CompanyLogo>(entity =>
{
entity.HasKey(e => new {e.Id, e.CompanyId, LogoGuid = e.Guid});
@@ -273,7 +273,7 @@ namespace Cicm.Database.Models
.HasDefaultValueSql("''");
});
modelBuilder.Entity<Gpus>(entity =>
modelBuilder.Entity<Gpu>(entity =>
{
entity.ToTable("gpus");
@@ -341,7 +341,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_gpus_by_machine_machine");
});
modelBuilder.Entity<InstructionSetExtensions>(entity =>
modelBuilder.Entity<InstructionSetExtension>(entity =>
{
entity.ToTable("instruction_set_extensions");
@@ -375,14 +375,13 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_extension_processor_id");
});
modelBuilder.Entity<InstructionSets>(entity =>
modelBuilder.Entity<InstructionSet>(entity =>
{
entity.ToTable("instruction_sets");
entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)");
entity.Property(e => e.InstructionSet).IsRequired().HasColumnName("instruction_set")
.HasColumnType("varchar(45)");
entity.Property(e => e.Name).IsRequired().HasColumnName("instruction_set").HasColumnType("varchar(45)");
});
modelBuilder.Entity<Iso31661Numeric>(entity =>
@@ -423,7 +422,7 @@ namespace Cicm.Database.Models
.HasDefaultValueSql("''");
});
modelBuilder.Entity<MachineFamilies>(entity =>
modelBuilder.Entity<MachineFamily>(entity =>
{
entity.ToTable("machine_families");
@@ -441,7 +440,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_machine_families_company");
});
modelBuilder.Entity<Machines>(entity =>
modelBuilder.Entity<Machine>(entity =>
{
entity.ToTable("machines");
@@ -509,7 +508,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_memory_by_machine_machine");
});
modelBuilder.Entity<MoneyDonations>(entity =>
modelBuilder.Entity<MoneyDonation>(entity =>
{
entity.ToTable("money_donations");
@@ -547,7 +546,7 @@ namespace Cicm.Database.Models
entity.Property(e => e.Type).HasColumnName("type").HasColumnType("int(11)").HasDefaultValueSql("'0'");
});
modelBuilder.Entity<OwnedComputers>(entity =>
modelBuilder.Entity<OwnedComputer>(entity =>
{
entity.ToTable("owned_computers");
@@ -628,7 +627,7 @@ namespace Cicm.Database.Models
entity.Property(e => e.Vram).HasColumnName("vram").HasColumnType("int(11)").HasDefaultValueSql("'0'");
});
modelBuilder.Entity<OwnedConsoles>(entity =>
modelBuilder.Entity<OwnedConsole>(entity =>
{
entity.ToTable("owned_consoles");
@@ -662,7 +661,7 @@ namespace Cicm.Database.Models
entity.Property(e => e.Trade).HasColumnName("trade").HasColumnType("int(11)").HasDefaultValueSql("'0'");
});
modelBuilder.Entity<Processors>(entity =>
modelBuilder.Entity<Processor>(entity =>
{
entity.ToTable("processors");
@@ -797,7 +796,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_processors_by_machine_processor");
});
modelBuilder.Entity<Resolutions>(entity =>
modelBuilder.Entity<Resolution>(entity =>
{
entity.ToTable("resolutions");
@@ -874,7 +873,7 @@ namespace Cicm.Database.Models
.HasConstraintName("fk_sound_by_machine_sound_synth");
});
modelBuilder.Entity<SoundSynths>(entity =>
modelBuilder.Entity<SoundSynth>(entity =>
{
entity.ToTable("sound_synths");