mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Rename logos in company model.
This commit is contained in:
1750
Cicm.Database/Migrations/20180807193120_CorrectLogosInCompany.Designer.cs
generated
Normal file
1750
Cicm.Database/Migrations/20180807193120_CorrectLogosInCompany.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
/******************************************************************************
|
||||
// Canary Islands Computer Museum Website
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : 20180807193120_CorrectLogosInCompany.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Renames logos in company.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2018 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Cicm.Database.Migrations
|
||||
{
|
||||
public partial class CorrectLogosInCompany : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder) { }
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) { }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Cicm.Database.Models
|
||||
{
|
||||
@@ -37,7 +38,7 @@ namespace Cicm.Database.Models
|
||||
{
|
||||
public Company()
|
||||
{
|
||||
CompanyLogos = new HashSet<CompanyLogo>();
|
||||
Logos = new HashSet<CompanyLogo>();
|
||||
Gpus = new HashSet<Gpu>();
|
||||
InverseSoldToNavigation = new HashSet<Company>();
|
||||
MachineFamilies = new HashSet<MachineFamily>();
|
||||
@@ -64,12 +65,14 @@ namespace Cicm.Database.Models
|
||||
public virtual Iso31661Numeric Country { get; set; }
|
||||
public virtual Company SoldTo { get; set; }
|
||||
public virtual CompanyDescription Description { get; set; }
|
||||
public virtual ICollection<CompanyLogo> CompanyLogos { get; set; }
|
||||
public virtual ICollection<CompanyLogo> Logos { get; set; }
|
||||
public virtual ICollection<Gpu> Gpus { get; set; }
|
||||
public virtual ICollection<Company> InverseSoldToNavigation { get; set; }
|
||||
public virtual ICollection<MachineFamily> MachineFamilies { get; set; }
|
||||
public virtual ICollection<Machine> Machines { get; set; }
|
||||
public virtual ICollection<Processor> Processors { get; set; }
|
||||
public virtual ICollection<SoundSynth> SoundSynths { get; set; }
|
||||
public virtual CompanyLogo LastLogo =>
|
||||
Logos?.OrderByDescending(l => l.Year).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ namespace Cicm.Database.Models
|
||||
|
||||
entity.Property(e => e.Year).HasColumnName("year").HasColumnType("int(4)");
|
||||
|
||||
entity.HasOne(d => d.Company).WithMany(p => p.CompanyLogos).HasForeignKey(d => d.CompanyId)
|
||||
entity.HasOne(d => d.Company).WithMany(p => p.Logos).HasForeignKey(d => d.CompanyId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("fk_company_logos_company1");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user