State of OMG-LEGION prior to merge
This commit is contained in:
@@ -15,18 +15,23 @@ namespace PartSource.Data.Contexts
|
||||
|
||||
public DbSet<Fitment> Fitments { get; set; }
|
||||
|
||||
public DbSet<FitmentNote> FitmentNotes { get; set; }
|
||||
|
||||
public DbSet<Vehicle> Vehicles { get; set; }
|
||||
|
||||
public DbSet<Wiper> Wipers { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<DcfMapping>().HasKey(d => new { d.LineCode, d.WhiCode });
|
||||
modelBuilder.Entity<Fitment>().HasKey(f => new { f.BaseVehicleId, f.EngineConfigId, f.LineCode, f.PartNumber });
|
||||
modelBuilder.Entity<Wiper>().HasKey(f => new { f.BaseVehicleId, f.PartNumber, f.LineCode, f.Position});
|
||||
|
||||
foreach (IMutableEntityType entityType in modelBuilder.Model.GetEntityTypes())
|
||||
{
|
||||
entityType.Relational().TableName = entityType.ClrType.Name;
|
||||
entityType.SetTableName(entityType.ClrType.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,7 @@ namespace PartSource.Data.Contexts
|
||||
|
||||
public DbSet<ApiClient> ApiClients { get; set; }
|
||||
|
||||
public DbSet<ProductBackup> ProductBackups { get; set; }
|
||||
|
||||
public DbSet<Manufacturer> Manufacturers { get; set; }
|
||||
public DbSet<DcfMapping> DcfMappings { get; set; }
|
||||
|
||||
public DbSet<ImportData> ImportData { get; set; }
|
||||
|
||||
@@ -36,27 +34,22 @@ namespace PartSource.Data.Contexts
|
||||
|
||||
public DbSet<PartsAvailability> PartAvailabilities { get; set; }
|
||||
|
||||
public DbQuery<BaseVehicle> BaseVehicles { get; set; }
|
||||
public DbSet<BaseVehicle> BaseVehicles { get; set; }
|
||||
|
||||
public DbQuery<Engine> Engines { get; set; }
|
||||
public DbSet<Engine> Engines { get; set; }
|
||||
|
||||
public DbQuery<Submodel> Submodels { get; set; }
|
||||
public DbSet<Submodel> Submodels { get; set; }
|
||||
|
||||
public DbQuery<VehicleMake> VehicleMakes { get; set; }
|
||||
public DbSet<VehicleMake> VehicleMakes { get; set; }
|
||||
|
||||
public DbQuery<VehicleModel> VehicleModels { get; set; }
|
||||
public DbSet<VehicleModel> VehicleModels { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Query<BaseVehicle>().ToView(nameof(BaseVehicle));
|
||||
modelBuilder.Query<Engine>().ToView(nameof(Engine));
|
||||
modelBuilder.Query<Submodel>().ToView(nameof(Submodel));
|
||||
modelBuilder.Query<VehicleMake>().ToView(nameof(VehicleMake));
|
||||
modelBuilder.Query<VehicleModel>().ToView(nameof(VehicleModel));
|
||||
|
||||
modelBuilder.Entity<PartsAvailability>().HasKey(p => new { p.Store, p.SKU });
|
||||
modelBuilder.Entity<DcfMapping>().HasKey(d => new { d.LineCode, d.WhiCode });
|
||||
|
||||
modelBuilder.Entity<ShopifyChangelog>()
|
||||
.Property(s => s.ResourceType)
|
||||
@@ -68,7 +61,7 @@ namespace PartSource.Data.Contexts
|
||||
|
||||
foreach (IMutableEntityType entityType in modelBuilder.Model.GetEntityTypes())
|
||||
{
|
||||
entityType.Relational().TableName = entityType.ClrType.Name;
|
||||
entityType.SetTableName(entityType.ClrType.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
@@ -7,6 +8,7 @@ namespace PartSource.Data.Models
|
||||
{
|
||||
public class BaseVehicle
|
||||
{
|
||||
[Key]
|
||||
public int BaseVehicleId { get; set; }
|
||||
|
||||
public string Make { get; set; }
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace PartSource.Data.Models
|
||||
{
|
||||
|
||||
public class Engine
|
||||
{
|
||||
[Key]
|
||||
public int EngineConfigId { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
17
PartSource.Data/Models/FitmentNote.cs
Normal file
17
PartSource.Data/Models/FitmentNote.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Data.Models
|
||||
{
|
||||
public class FitmentNote
|
||||
{
|
||||
public string NoteText { get; set; }
|
||||
|
||||
[Key]
|
||||
public string Hash { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,14 @@
|
||||
// Decompiled with JetBrains decompiler
|
||||
// Type: PartSource.Data.Models.Part
|
||||
// Assembly: PartSource.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 3EDAB3F5-83E7-4F65-906E-B40192014C57
|
||||
// Assembly location: C:\Users\Tommy\Desktop\PS temp\PartSource.Data.dll
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PartSource.Data.Models
|
||||
{
|
||||
public class Part
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public class Part
|
||||
{
|
||||
[Key]
|
||||
public string Sku { get; set; }
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
public int ManufacturerId { get; set; }
|
||||
|
||||
public long? ShopifyId { get; set; }
|
||||
|
||||
public int Sku { get; set; }
|
||||
|
||||
public string PartNumber { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public Manufacturer Manufacturer { get; set; }
|
||||
}
|
||||
public string PartNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace PartSource.Data.Models
|
||||
{
|
||||
public class Submodel
|
||||
{
|
||||
[Key]
|
||||
public int SubmodelId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
@@ -8,6 +9,7 @@ namespace PartSource.Data.Models
|
||||
public class VehicleMake
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Key]
|
||||
public int MakeId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace PartSource.Data.Models
|
||||
public class VehicleModel
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Key]
|
||||
public int ModelId { get; set; }
|
||||
|
||||
public int Year { get; set; }
|
||||
|
||||
21
PartSource.Data/Models/Wiper.cs
Normal file
21
PartSource.Data/Models/Wiper.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Data.Models
|
||||
{
|
||||
public class Wiper
|
||||
{
|
||||
public int BaseVehicleId { get; set; }
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
public string PartNumber { get; set; }
|
||||
|
||||
public string Position { get; set; }
|
||||
|
||||
public string PartName { get; set; }
|
||||
}
|
||||
}
|
||||
30
PartSource.Data/Nexpart/App.cs
Normal file
30
PartSource.Data/Nexpart/App.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class App
|
||||
{
|
||||
[XmlElement]
|
||||
[JsonProperty("lineCode")]
|
||||
public string MfrCode { get; set; }
|
||||
|
||||
[XmlElement]
|
||||
[JsonProperty("description")]
|
||||
public string MfrLabel { get; set; }
|
||||
|
||||
[XmlElement]
|
||||
[JsonProperty("position")]
|
||||
public string Position { get; set; }
|
||||
|
||||
[XmlElement]
|
||||
[JsonProperty("partNumber")]
|
||||
public string Part { get; set; }
|
||||
}
|
||||
}
|
||||
39
PartSource.Data/Nexpart/ApplicationSearch.cs
Normal file
39
PartSource.Data/Nexpart/ApplicationSearch.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectService-v1")]
|
||||
public class ApplicationSearch
|
||||
{
|
||||
public ApplicationSearch()
|
||||
{
|
||||
PSRequestHeader = new PSRequestHeader();
|
||||
}
|
||||
|
||||
[XmlElement(Order = 1)]
|
||||
public PSRequestHeader PSRequestHeader { get; set; }
|
||||
|
||||
[XmlElement(Order = 2)]
|
||||
public VehicleIdentifier VehicleIdentifier { get; set; }
|
||||
|
||||
[XmlElement(Order = 3)]
|
||||
public string[] MfrCode { get; set; }
|
||||
|
||||
[XmlElement(Order = 4)]
|
||||
public PartType[] PartType { get; set; }
|
||||
|
||||
[XmlElement(Order = 5)]
|
||||
public bool SecondaryDCF => true;
|
||||
|
||||
[XmlElement(Order = 6)]
|
||||
public Criterion[] Criterion { get; set; }
|
||||
|
||||
[XmlElement(Order = 7)]
|
||||
public string GroupBy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
using PartSource.Data.Nexpart.Interfaces;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using PartSource.Data.Nexpart.Interfaces;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectService-v1")]
|
||||
public class BuyersGuideSearchResponse : IResponseElement<BuyersGuideData>
|
||||
public class ApplicationSearchResponse : IResponseElement<Apps>
|
||||
{
|
||||
|
||||
[XmlElement]
|
||||
public PSResponseHeader PSResponseHeader { get; set; }
|
||||
|
||||
[XmlElement(ElementName = "BuyersGuideData")]
|
||||
public BuyersGuideData ResponseBody { get; set; }
|
||||
[XmlElement(ElementName = nameof(Apps))]
|
||||
public Apps ResponseBody { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class Apps
|
||||
{
|
||||
[XmlElement]
|
||||
public BuyersGuideMake[] Make { get; set; }
|
||||
[XmlElement(Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
[JsonProperty("wipers")]
|
||||
public App[] App { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace PartSource.Data.Nexpart
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectService-v1")]
|
||||
public class Body
|
||||
{
|
||||
[XmlElement(ElementName = "ApplicationSearch", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(ApplicationSearch))]
|
||||
[XmlElement(ElementName = "ApplicationSearchResponse", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(ApplicationSearchResponse))]
|
||||
[XmlElement(ElementName = "BaseVehicleDetailLookup", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BaseVehicleDetailLookup))]
|
||||
[XmlElement(ElementName = "BaseVehicleDetailLookupResponse", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BaseVehicleDetailLookupResponse))]
|
||||
[XmlElement(ElementName = "BaseVehicleSearch", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BaseVehicleSearch))]
|
||||
[XmlElement(ElementName = "BaseVehicleSearchResponse", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BaseVehicleSearchResponse))]
|
||||
[XmlElement(ElementName = "BuyersGuideSearch", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BuyersGuideSearch))]
|
||||
[XmlElement(ElementName = "BuyersGuideSearchResponse", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(BuyersGuideSearchResponse))]
|
||||
[XmlElement(ElementName = "EngineSearch", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(EngineSearch))]
|
||||
[XmlElement(ElementName = "EngineSearchResponse", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(EngineSearchResponse))]
|
||||
[XmlElement(ElementName = "MakeSearch", Namespace = "http://whisolutions.com/PartSelectService-v1", Type = typeof(MakeSearch))]
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectService-v1")]
|
||||
public class BuyersGuideData
|
||||
{
|
||||
[XmlElement(Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public Apps Apps { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class BuyersGuideEngine
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Desc { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int PerVehicle { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int Year { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class BuyersGuideMake
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int FromYear { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int ToYear { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int MakeCount { get; set; }
|
||||
|
||||
[XmlElement]
|
||||
public BuyersGuideModel[] Model { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class BuyersGuideModel
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int FromYear { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int ToYear { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int ModelCount { get; set; }
|
||||
|
||||
[XmlElement]
|
||||
public BuyersGuideEngine[] Engine { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectServ/2011-07-21")]
|
||||
public class BuyersGuidePart
|
||||
{
|
||||
[XmlAttribute]
|
||||
public string PartNumber { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string MfrCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlType(AnonymousType = true, Namespace = "http://whisolutions.com/PartSelectService-v1")]
|
||||
public class BuyersGuideSearch
|
||||
{
|
||||
public BuyersGuideSearch()
|
||||
{
|
||||
PSRequestHeader = new PSRequestHeader();
|
||||
}
|
||||
|
||||
[XmlElement(Order = 1)]
|
||||
public PSRequestHeader PSRequestHeader { get; set; }
|
||||
|
||||
[XmlElement(Order = 2)]
|
||||
public BuyersGuidePart Part { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,5 @@ namespace PartSource.Data.Nexpart
|
||||
{
|
||||
[XmlAttribute]
|
||||
public int Id { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int PositionGroupId { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="AutoMapper" Version="11.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user