私は7つのクラスを持っています:
public class Entity
{
public int Id { get; set; }
}
public class Product : ????
{
// Contructor
public Product()
{
Photos = new HashSet<PhotoSource>();
ProductFeatures = new HashSet<ProductFeature>();
}
// Primitives
public string ProductName { get; set; }
public string InternalSKU { get; set; }
public string ModelNumber { get; set; }
public string Description { get; set; }
public int QtyPerUnit { get; set; }
public double UnitPrice { get; set; }
public int UnitsInStock { get; set; }
public int UnitsOnOrder { get; set; }
public int? ReOrderLevel { get; set; }
public string Warranty { get; set; }
// Foreign Keys
public int SubCategoryID { get; set; }
public int VendorId { get; set; }
// Navigation Properties
// Classes
[ForeignKey("SubCategoryID")]
public virtual SubCategory SubCategory { get; set; }
[ForeignKey("VendorId")]
public virtual Vendor Vendor { get; set; }
// Collections
public virtual ICollection<PhotoSource> Photos { get; set; }
public virtual ICollection<ProductFeature> ProductFeatures { get; set; }
}
public class ProductSeasonal : ????
{
// Primitives
public int? OffSeasonDiscount { get; set; }
public DateTime SeasonStartDate { get; set; }
public DateTime SeasonEndDate { get; set; }
public int? QtyLimitedTo { get; set; }
}
public class ProductDiscontinued : ????
{
// Primitives
public DateTime DiscontinuedDate { get; set; }
public int DiscontinuedDisount { get; set; }
}
public class Supply : ????
{
// Primitives
public String UnitMeasurement { get; set; }
}
public class Part : ????
{
// Primitives
public String UnitMeasurement { get; set; }
}
public class Vehicle : ????
{
// Constructor
public Vehicle()
{
ExteriorFeatures = new HashSet<ProductFeature>();
InteriorFeatures = new HashSet<ProductFeature>();
SafetyFeatures = new HashSet<ProductFeature>();
}
// Primitives
public string VIN { get; set; }
public int Year { get; set; }
public int CylinderSize { get; set; }
public double EngineSize { get; set; }
public string StyleType { get; set; } //Truck, SUV, Sedan, Convertible, etc
public string TransmissionType { get; set; }
public string InteriorColor { get; set; }
public string ExteriorColor { get; set; }
// Foreign Keys
public virtual int MakeId { get; set; }
// Navigation Properties
// Classes
[ForeignKey("MakeId")]
public virtual VehicleMake Make { get; set; }
// Collections
public virtual ICollection<ProductFeature> InteriorFeatures { get; set; }
public virtual ICollection<ProductFeature> ExteriorFeatures { get; set; }
public virtual ICollection<ProductFeature> SafetyFeatures { get; set; }
}
車両、部品、消耗品、および将来の販売品目クラス [例: 衣類] 冗長なプロパティをコード化して大騒ぎせずに追加できますか?