mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-05 06:15:24 +00:00
Initial commit
This commit is contained in:
parent
1d9d051759
commit
9656378279
557 changed files with 182300 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class AlphabeticalListOfProduct
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
public int? SupplierId { get; set; }
|
||||
public int? CategoryId { get; set; }
|
||||
[StringLength(20)]
|
||||
public string? QuantityPerUnit { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? UnitPrice { get; set; }
|
||||
public short? UnitsInStock { get; set; }
|
||||
public short? UnitsOnOrder { get; set; }
|
||||
public short? ReorderLevel { get; set; }
|
||||
public bool Discontinued { get; set; }
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("CategoryName", Name = "CategoryName")]
|
||||
public partial class Category
|
||||
{
|
||||
public Category()
|
||||
{
|
||||
Products = new HashSet<Product>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int CategoryId { get; set; }
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
[Column(TypeName = "ntext")]
|
||||
public string? Description { get; set; }
|
||||
[Column(TypeName = "image")]
|
||||
public byte[]? Picture { get; set; }
|
||||
|
||||
[InverseProperty("Category")]
|
||||
public virtual ICollection<Product> Products { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class CategorySalesFor1997
|
||||
{
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? CategorySales { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class CurrentProductList
|
||||
{
|
||||
[Column("ProductID")]
|
||||
public int ProductId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Xml.Serialization; // [XmlIgnore]
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("City", Name = "City")]
|
||||
[Index("CompanyName", Name = "CompanyName")]
|
||||
[Index("PostalCode", Name = "PostalCode")]
|
||||
[Index("Region", Name = "Region")]
|
||||
public partial class Customer
|
||||
{
|
||||
public Customer()
|
||||
{
|
||||
Orders = new HashSet<Order>();
|
||||
CustomerTypes = new HashSet<CustomerDemographic>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[StringLength(5)]
|
||||
[RegularExpression("[A-Z]{5}")]
|
||||
[Required]
|
||||
public string CustomerId { get; set; } = null!;
|
||||
|
||||
[StringLength(40)]
|
||||
[Required]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
|
||||
[StringLength(30)]
|
||||
public string? ContactName { get; set; }
|
||||
[StringLength(30)]
|
||||
public string? ContactTitle { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Phone { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Fax { get; set; }
|
||||
|
||||
[InverseProperty("Customer")]
|
||||
[XmlIgnore]
|
||||
public virtual ICollection<Order> Orders { get; set; }
|
||||
|
||||
[ForeignKey("CustomerId")]
|
||||
[InverseProperty("Customers")]
|
||||
[XmlIgnore]
|
||||
public virtual ICollection<CustomerDemographic> CustomerTypes { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class CustomerAndSuppliersByCity
|
||||
{
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
[StringLength(30)]
|
||||
public string? ContactName { get; set; }
|
||||
[StringLength(9)]
|
||||
[Unicode(false)]
|
||||
public string Relationship { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
public partial class CustomerDemographic
|
||||
{
|
||||
public CustomerDemographic()
|
||||
{
|
||||
Customers = new HashSet<Customer>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[Column("CustomerTypeID")]
|
||||
[StringLength(10)]
|
||||
public string CustomerTypeId { get; set; } = null!;
|
||||
[Column(TypeName = "ntext")]
|
||||
public string? CustomerDesc { get; set; }
|
||||
|
||||
[ForeignKey("CustomerTypeId")]
|
||||
[InverseProperty("CustomerTypes")]
|
||||
public virtual ICollection<Customer> Customers { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("LastName", Name = "LastName")]
|
||||
[Index("PostalCode", Name = "PostalCode")]
|
||||
public partial class Employee
|
||||
{
|
||||
public Employee()
|
||||
{
|
||||
InverseReportsToNavigation = new HashSet<Employee>();
|
||||
Orders = new HashSet<Order>();
|
||||
Territories = new HashSet<Territory>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int EmployeeId { get; set; }
|
||||
[StringLength(20)]
|
||||
public string LastName { get; set; } = null!;
|
||||
[StringLength(10)]
|
||||
public string FirstName { get; set; } = null!;
|
||||
[StringLength(30)]
|
||||
public string? Title { get; set; }
|
||||
[StringLength(25)]
|
||||
public string? TitleOfCourtesy { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? BirthDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? HireDate { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? HomePhone { get; set; }
|
||||
[StringLength(4)]
|
||||
public string? Extension { get; set; }
|
||||
[Column(TypeName = "image")]
|
||||
public byte[]? Photo { get; set; }
|
||||
[Column(TypeName = "ntext")]
|
||||
public string? Notes { get; set; }
|
||||
public int? ReportsTo { get; set; }
|
||||
[StringLength(255)]
|
||||
public string? PhotoPath { get; set; }
|
||||
|
||||
[ForeignKey("ReportsTo")]
|
||||
[InverseProperty("InverseReportsToNavigation")]
|
||||
public virtual Employee? ReportsToNavigation { get; set; }
|
||||
[InverseProperty("ReportsToNavigation")]
|
||||
public virtual ICollection<Employee> InverseReportsToNavigation { get; set; }
|
||||
[InverseProperty("Employee")]
|
||||
public virtual ICollection<Order> Orders { get; set; }
|
||||
|
||||
[ForeignKey("EmployeeId")]
|
||||
[InverseProperty("Employees")]
|
||||
public virtual ICollection<Territory> Territories { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class Invoice
|
||||
{
|
||||
[StringLength(40)]
|
||||
public string? ShipName { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? ShipAddress { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCity { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipRegion { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? ShipPostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCountry { get; set; }
|
||||
[Column("CustomerID")]
|
||||
[StringLength(5)]
|
||||
public string? CustomerId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CustomerName { get; set; } = null!;
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
[StringLength(31)]
|
||||
public string Salesperson { get; set; } = null!;
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? OrderDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? RequiredDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ShipperName { get; set; } = null!;
|
||||
[Column("ProductID")]
|
||||
public int ProductId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal UnitPrice { get; set; }
|
||||
public short Quantity { get; set; }
|
||||
public float Discount { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? ExtendedPrice { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Freight { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="System.Console" Static="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference
|
||||
Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-*" />
|
||||
<PackageReference
|
||||
Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-*">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("CustomerId", Name = "CustomerId")]
|
||||
[Index("CustomerId", Name = "CustomersOrders")]
|
||||
[Index("EmployeeId", Name = "EmployeeId")]
|
||||
[Index("EmployeeId", Name = "EmployeesOrders")]
|
||||
[Index("OrderDate", Name = "OrderDate")]
|
||||
[Index("ShipPostalCode", Name = "ShipPostalCode")]
|
||||
[Index("ShippedDate", Name = "ShippedDate")]
|
||||
[Index("ShipVia", Name = "ShippersOrders")]
|
||||
public partial class Order
|
||||
{
|
||||
public Order()
|
||||
{
|
||||
OrderDetails = new HashSet<OrderDetail>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int OrderId { get; set; }
|
||||
[StringLength(5)]
|
||||
public string? CustomerId { get; set; }
|
||||
public int? EmployeeId { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? OrderDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? RequiredDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
public int? ShipVia { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Freight { get; set; }
|
||||
[StringLength(40)]
|
||||
public string? ShipName { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? ShipAddress { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCity { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipRegion { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? ShipPostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCountry { get; set; }
|
||||
|
||||
[ForeignKey("CustomerId")]
|
||||
[InverseProperty("Orders")]
|
||||
public virtual Customer? Customer { get; set; }
|
||||
[ForeignKey("EmployeeId")]
|
||||
[InverseProperty("Orders")]
|
||||
public virtual Employee? Employee { get; set; }
|
||||
[ForeignKey("ShipVia")]
|
||||
[InverseProperty("Orders")]
|
||||
public virtual Shipper? ShipViaNavigation { get; set; }
|
||||
[InverseProperty("Order")]
|
||||
public virtual ICollection<OrderDetail> OrderDetails { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Table("Order Details")]
|
||||
[Index("OrderId", Name = "OrderId")]
|
||||
[Index("OrderId", Name = "OrdersOrder_Details")]
|
||||
[Index("ProductId", Name = "ProductId")]
|
||||
[Index("ProductId", Name = "ProductsOrder_Details")]
|
||||
public partial class OrderDetail
|
||||
{
|
||||
[Key]
|
||||
public int OrderId { get; set; }
|
||||
[Key]
|
||||
public int ProductId { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal UnitPrice { get; set; }
|
||||
public short Quantity { get; set; }
|
||||
public float Discount { get; set; }
|
||||
|
||||
[ForeignKey("OrderId")]
|
||||
[InverseProperty("OrderDetails")]
|
||||
public virtual Order Order { get; set; } = null!;
|
||||
[ForeignKey("ProductId")]
|
||||
[InverseProperty("OrderDetails")]
|
||||
public virtual Product Product { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class OrderDetailsExtended
|
||||
{
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column("ProductID")]
|
||||
public int ProductId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal UnitPrice { get; set; }
|
||||
public short Quantity { get; set; }
|
||||
public float Discount { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? ExtendedPrice { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class OrderSubtotal
|
||||
{
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Subtotal { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class OrdersQry
|
||||
{
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column("CustomerID")]
|
||||
[StringLength(5)]
|
||||
public string? CustomerId { get; set; }
|
||||
[Column("EmployeeID")]
|
||||
public int? EmployeeId { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? OrderDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? RequiredDate { get; set; }
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
public int? ShipVia { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Freight { get; set; }
|
||||
[StringLength(40)]
|
||||
public string? ShipName { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? ShipAddress { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCity { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipRegion { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? ShipPostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? ShipCountry { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("CategoryId", Name = "CategoriesProducts")]
|
||||
[Index("CategoryId", Name = "CategoryId")]
|
||||
[Index("ProductName", Name = "ProductName")]
|
||||
[Index("SupplierId", Name = "SupplierId")]
|
||||
[Index("SupplierId", Name = "SuppliersProducts")]
|
||||
public partial class Product
|
||||
{
|
||||
public Product()
|
||||
{
|
||||
OrderDetails = new HashSet<OrderDetail>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int ProductId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
public int? SupplierId { get; set; }
|
||||
public int? CategoryId { get; set; }
|
||||
[StringLength(20)]
|
||||
public string? QuantityPerUnit { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? UnitPrice { get; set; }
|
||||
public short? UnitsInStock { get; set; }
|
||||
public short? UnitsOnOrder { get; set; }
|
||||
public short? ReorderLevel { get; set; }
|
||||
public bool Discontinued { get; set; }
|
||||
|
||||
[ForeignKey("CategoryId")]
|
||||
[InverseProperty("Products")]
|
||||
public virtual Category? Category { get; set; }
|
||||
[ForeignKey("SupplierId")]
|
||||
[InverseProperty("Products")]
|
||||
public virtual Supplier? Supplier { get; set; }
|
||||
[InverseProperty("Product")]
|
||||
public virtual ICollection<OrderDetail> OrderDetails { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class ProductSalesFor1997
|
||||
{
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? ProductSales { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class ProductsAboveAveragePrice
|
||||
{
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? UnitPrice { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class ProductsByCategory
|
||||
{
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[StringLength(20)]
|
||||
public string? QuantityPerUnit { get; set; }
|
||||
public short? UnitsInStock { get; set; }
|
||||
public bool Discontinued { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class QuarterlyOrder
|
||||
{
|
||||
[Column("CustomerID")]
|
||||
[StringLength(5)]
|
||||
public string? CustomerId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string? CompanyName { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Table("Region")]
|
||||
public partial class Region
|
||||
{
|
||||
public Region()
|
||||
{
|
||||
Territories = new HashSet<Territory>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[Column("RegionID")]
|
||||
public int RegionId { get; set; }
|
||||
[StringLength(50)]
|
||||
public string RegionDescription { get; set; } = null!;
|
||||
|
||||
[InverseProperty("Region")]
|
||||
public virtual ICollection<Territory> Territories { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class SalesByCategory
|
||||
{
|
||||
[Column("CategoryID")]
|
||||
public int CategoryId { get; set; }
|
||||
[StringLength(15)]
|
||||
public string CategoryName { get; set; } = null!;
|
||||
[StringLength(40)]
|
||||
public string ProductName { get; set; } = null!;
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? ProductSales { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class SalesTotalsByAmount
|
||||
{
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? SaleAmount { get; set; }
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
public partial class Shipper
|
||||
{
|
||||
public Shipper()
|
||||
{
|
||||
Orders = new HashSet<Order>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int ShipperId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
[StringLength(24)]
|
||||
public string? Phone { get; set; }
|
||||
|
||||
[InverseProperty("ShipViaNavigation")]
|
||||
public virtual ICollection<Order> Orders { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class SummaryOfSalesByQuarter
|
||||
{
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Subtotal { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Keyless]
|
||||
public partial class SummaryOfSalesByYear
|
||||
{
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime? ShippedDate { get; set; }
|
||||
[Column("OrderID")]
|
||||
public int OrderId { get; set; }
|
||||
[Column(TypeName = "money")]
|
||||
public decimal? Subtotal { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("CompanyName", Name = "CompanyName")]
|
||||
[Index("PostalCode", Name = "PostalCode")]
|
||||
public partial class Supplier
|
||||
{
|
||||
public Supplier()
|
||||
{
|
||||
Products = new HashSet<Product>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int SupplierId { get; set; }
|
||||
[StringLength(40)]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
[StringLength(30)]
|
||||
public string? ContactName { get; set; }
|
||||
[StringLength(30)]
|
||||
public string? ContactTitle { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Phone { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Fax { get; set; }
|
||||
[Column(TypeName = "ntext")]
|
||||
public string? HomePage { get; set; }
|
||||
|
||||
[InverseProperty("Supplier")]
|
||||
public virtual ICollection<Product> Products { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
public partial class Territory
|
||||
{
|
||||
public Territory()
|
||||
{
|
||||
Employees = new HashSet<Employee>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[Column("TerritoryID")]
|
||||
[StringLength(20)]
|
||||
public string TerritoryId { get; set; } = null!;
|
||||
[StringLength(50)]
|
||||
public string TerritoryDescription { get; set; } = null!;
|
||||
[Column("RegionID")]
|
||||
public int RegionId { get; set; }
|
||||
|
||||
[ForeignKey("RegionId")]
|
||||
[InverseProperty("Territories")]
|
||||
public virtual Region Region { get; set; } = null!;
|
||||
|
||||
[ForeignKey("TerritoryId")]
|
||||
[InverseProperty("Territories")]
|
||||
public virtual ICollection<Employee> Employees { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue