New version of Telerik SDK examples.

This commit is contained in:
ProgressGitHubBuildUser 2020-09-17 16:41:15 +03:00
Родитель c2969fb330
Коммит 251562ba1c
47 изменённых файлов: 7282 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,9 @@
<Application x:Class="DatabaseFirstNorthwind.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DatabaseFirstNorthwind"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace DatabaseFirstNorthwind
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

Просмотреть файл

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

Просмотреть файл

@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Telerik.Windows.Controls">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Data">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Controls.Data.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.GridView">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Controls.GridView.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Input">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Controls.Input.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.EntityFrameworkCore">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Controls.EntityFrameworkCore.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Data">
<HintPath>$(TELERIKWPFDIR)\Binaries\NetCore\Telerik.Windows.Data.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,80 @@
<Window x:Class="DatabaseFirstNorthwind.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DatabaseFirstNorthwind"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadEntityFrameworkCoreDataSource x:Name="coreDataSource" QueryName="Customers">
<telerik:RadEntityFrameworkCoreDataSource.RelatedObjects>
<sys:String>Orders</sys:String>
</telerik:RadEntityFrameworkCoreDataSource.RelatedObjects>
<telerik:RadEntityFrameworkCoreDataSource.DbContext>
<local:NorthwindContext />
</telerik:RadEntityFrameworkCoreDataSource.DbContext>
</telerik:RadEntityFrameworkCoreDataSource>
<telerik:RadGridView GroupRenderMode="Flat"
ItemsSource="{Binding PagedSource, ElementName=pager}"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
CanUserFreezeColumns="False"
CanUserResizeColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewToggleRowDetailsColumn />
<telerik:GridViewDataColumn Header="CustomerID"
DataMemberBinding="{Binding CustomerId}" />
<telerik:GridViewDataColumn Header="Company Name"
DataMemberBinding="{Binding CompanyName}" />
<telerik:GridViewDataColumn Header="Contact Name"
DataMemberBinding="{Binding ContactName}" />
<telerik:GridViewDataColumn Header="Contact Title"
DataMemberBinding="{Binding ContactTitle}" />
<telerik:GridViewDataColumn Header="Address"
DataMemberBinding="{Binding Address}" />
<telerik:GridViewDataColumn Header="City"
DataMemberBinding="{Binding City}" />
<telerik:GridViewDataColumn Header="Region"
DataMemberBinding="{Binding Region}" />
<telerik:GridViewDataColumn Header="PostalCode"
DataMemberBinding="{Binding PostalCode}" />
<telerik:GridViewDataColumn Header="Country"
DataMemberBinding="{Binding Country}" />
<telerik:GridViewDataColumn Header="Phone"
DataMemberBinding="{Binding Phone}" />
<telerik:GridViewDataColumn Header="Fax"
DataMemberBinding="{Binding Fax}" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowDetailsTemplate>
<DataTemplate>
<telerik:RadGridView GroupRenderMode="Flat" ItemsSource="{Binding Orders}" RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
CanUserFreezeColumns="False"
CanUserResizeColumns="False"
ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Order ID"
DataMemberBinding="{Binding OrderId}" />
<telerik:GridViewDataColumn Header="Order Date"
DataMemberBinding="{Binding OrderDate}" />
<telerik:GridViewDataColumn Header="Customer"
DataMemberBinding="{Binding ShipName}" />
<telerik:GridViewDataColumn Header="City"
DataMemberBinding="{Binding ShipCity}" />
<telerik:GridViewDataColumn Header="Country"
DataMemberBinding="{Binding ShipCountry}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>
<telerik:RadDataPager x:Name="pager" Source="{Binding DataView, ElementName=coreDataSource}" PageSize="5" Grid.Row="1" />
</Grid>
</Window>

Просмотреть файл

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DatabaseFirstNorthwind
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,613 @@
// <auto-generated />
using System;
using DatabaseFirstNorthwind;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DatabaseFirstNorthwind.Migrations
{
[DbContext(typeof(NorthwindContext))]
[Migration("20200723142538_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DatabaseFirstNorthwind.Category", b =>
{
b.Property<int>("CategoryId")
.ValueGeneratedOnAdd()
.HasColumnName("CategoryID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CategoryName")
.IsRequired()
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<byte[]>("Picture")
.HasColumnType("image");
b.HasKey("CategoryId");
b.ToTable("Categories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Customer", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("CustomerId");
b.ToTable("Customers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.HasKey("CustomerId", "CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("CustomerTypeId");
b.ToTable("CustomerCustomerDemo");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerDemographics", b =>
{
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.Property<string>("CustomerDesc")
.HasColumnType("ntext");
b.HasKey("CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("CustomerDemographics");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.Property<int>("EmployeeId")
.ValueGeneratedOnAdd()
.HasColumnName("EmployeeID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<DateTime?>("BirthDate")
.HasColumnType("datetime");
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Extension")
.HasColumnType("nvarchar(4)")
.HasMaxLength(4);
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<DateTime?>("HireDate")
.HasColumnType("datetime");
b.Property<string>("HomePhone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<string>("Notes")
.HasColumnType("ntext");
b.Property<byte[]>("Photo")
.HasColumnType("image");
b.Property<string>("PhotoPath")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ReportsTo")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("TitleOfCourtesy")
.HasColumnType("nvarchar(25)")
.HasMaxLength(25);
b.HasKey("EmployeeId");
b.HasIndex("ReportsTo");
b.ToTable("Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.Property<int>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.HasKey("EmployeeId", "TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("TerritoryId");
b.ToTable("EmployeeTerritories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnName("OrderID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<int?>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<decimal?>("Freight")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<DateTime?>("OrderDate")
.HasColumnType("datetime");
b.Property<DateTime?>("RequiredDate")
.HasColumnType("datetime");
b.Property<string>("ShipAddress")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("ShipCity")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipCountry")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipName")
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ShipPostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("ShipRegion")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ShipVia")
.HasColumnType("int");
b.Property<DateTime?>("ShippedDate")
.HasColumnType("datetime");
b.HasKey("OrderId");
b.HasIndex("CustomerId");
b.HasIndex("EmployeeId");
b.HasIndex("ShipVia");
b.ToTable("Orders");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.Property<int>("OrderId")
.HasColumnName("OrderID")
.HasColumnType("int");
b.Property<int>("ProductId")
.HasColumnName("ProductID")
.HasColumnType("int");
b.Property<float>("Discount")
.HasColumnType("real");
b.Property<short>("Quantity")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((1))");
b.Property<decimal>("UnitPrice")
.HasColumnType("money");
b.HasKey("OrderId", "ProductId")
.HasName("PK_Order_Details");
b.HasIndex("ProductId");
b.ToTable("Order Details");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.Property<int>("ProductId")
.ValueGeneratedOnAdd()
.HasColumnName("ProductID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("CategoryId")
.HasColumnName("CategoryID")
.HasColumnType("int");
b.Property<bool>("Discontinued")
.HasColumnType("bit");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("QuantityPerUnit")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<short?>("ReorderLevel")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<int?>("SupplierId")
.HasColumnName("SupplierID")
.HasColumnType("int");
b.Property<decimal?>("UnitPrice")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsInStock")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsOnOrder")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.HasKey("ProductId");
b.HasIndex("CategoryId");
b.HasIndex("SupplierId");
b.ToTable("Products");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Region", b =>
{
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("RegionDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("RegionId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("Region");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Shipper", b =>
{
b.Property<int>("ShipperId")
.ValueGeneratedOnAdd()
.HasColumnName("ShipperID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.HasKey("ShipperId");
b.ToTable("Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Supplier", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnName("SupplierID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("HomePage")
.HasColumnType("ntext");
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("SupplierId");
b.ToTable("Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("TerritoryDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("RegionId");
b.ToTable("Territories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_CustomerCustomerDemo_Customers")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.CustomerDemographics", "CustomerType")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerTypeId")
.HasConstraintName("FK_CustomerCustomerDemo")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Manager")
.WithMany("DirectReports")
.HasForeignKey("ReportsTo")
.HasConstraintName("FK_Employees_Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("EmployeeTerritories")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_EmployeeTerritories_Employees")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Territory", "Territory")
.WithMany("EmployeeTerritories")
.HasForeignKey("TerritoryId")
.HasConstraintName("FK_EmployeeTerritories_Territories")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("Orders")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_Orders_Customers");
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("Orders")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_Orders_Employees");
b.HasOne("DatabaseFirstNorthwind.Shipper", "Shipper")
.WithMany("Orders")
.HasForeignKey("ShipVia")
.HasConstraintName("FK_Orders_Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.HasOne("DatabaseFirstNorthwind.Order", "Order")
.WithMany("OrderDetails")
.HasForeignKey("OrderId")
.HasConstraintName("FK_Order_Details_Orders")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Product", "Product")
.WithMany("OrderDetails")
.HasForeignKey("ProductId")
.HasConstraintName("FK_Order_Details_Products")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.HasOne("DatabaseFirstNorthwind.Category", "Category")
.WithMany("Products")
.HasForeignKey("CategoryId")
.HasConstraintName("FK_Products_Categories");
b.HasOne("DatabaseFirstNorthwind.Supplier", "Supplier")
.WithMany("Products")
.HasForeignKey("SupplierId")
.HasConstraintName("FK_Products_Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Region", "Region")
.WithMany("Territories")
.HasForeignKey("RegionId")
.HasConstraintName("FK_Territories_Region")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

Просмотреть файл

@ -0,0 +1,410 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace DatabaseFirstNorthwind.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
CategoryID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CategoryName = table.Column<string>(maxLength: 15, nullable: false),
Description = table.Column<string>(type: "ntext", nullable: true),
Picture = table.Column<byte[]>(type: "image", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.CategoryID);
});
migrationBuilder.CreateTable(
name: "CustomerDemographics",
columns: table => new
{
CustomerTypeID = table.Column<string>(fixedLength: true, maxLength: 10, nullable: false),
CustomerDesc = table.Column<string>(type: "ntext", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomerDemographics", x => x.CustomerTypeID)
.Annotation("SqlServer:Clustered", false);
});
migrationBuilder.CreateTable(
name: "Customers",
columns: table => new
{
CustomerID = table.Column<string>(fixedLength: true, maxLength: 5, nullable: false),
CompanyName = table.Column<string>(maxLength: 40, nullable: false),
ContactName = table.Column<string>(maxLength: 30, nullable: true),
ContactTitle = table.Column<string>(maxLength: 30, nullable: true),
Address = table.Column<string>(maxLength: 60, nullable: true),
City = table.Column<string>(maxLength: 15, nullable: true),
Region = table.Column<string>(maxLength: 15, nullable: true),
PostalCode = table.Column<string>(maxLength: 10, nullable: true),
Country = table.Column<string>(maxLength: 15, nullable: true),
Phone = table.Column<string>(maxLength: 24, nullable: true),
Fax = table.Column<string>(maxLength: 24, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Customers", x => x.CustomerID);
});
migrationBuilder.CreateTable(
name: "Employees",
columns: table => new
{
EmployeeID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LastName = table.Column<string>(maxLength: 20, nullable: false),
FirstName = table.Column<string>(maxLength: 10, nullable: false),
Title = table.Column<string>(maxLength: 30, nullable: true),
TitleOfCourtesy = table.Column<string>(maxLength: 25, nullable: true),
BirthDate = table.Column<DateTime>(type: "datetime", nullable: true),
HireDate = table.Column<DateTime>(type: "datetime", nullable: true),
Address = table.Column<string>(maxLength: 60, nullable: true),
City = table.Column<string>(maxLength: 15, nullable: true),
Region = table.Column<string>(maxLength: 15, nullable: true),
PostalCode = table.Column<string>(maxLength: 10, nullable: true),
Country = table.Column<string>(maxLength: 15, nullable: true),
HomePhone = table.Column<string>(maxLength: 24, nullable: true),
Extension = table.Column<string>(maxLength: 4, nullable: true),
Photo = table.Column<byte[]>(type: "image", nullable: true),
Notes = table.Column<string>(type: "ntext", nullable: true),
ReportsTo = table.Column<int>(nullable: true),
PhotoPath = table.Column<string>(maxLength: 255, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Employees", x => x.EmployeeID);
table.ForeignKey(
name: "FK_Employees_Employees",
column: x => x.ReportsTo,
principalTable: "Employees",
principalColumn: "EmployeeID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Region",
columns: table => new
{
RegionID = table.Column<int>(nullable: false),
RegionDescription = table.Column<string>(fixedLength: true, maxLength: 50, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Region", x => x.RegionID)
.Annotation("SqlServer:Clustered", false);
});
migrationBuilder.CreateTable(
name: "Shippers",
columns: table => new
{
ShipperID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CompanyName = table.Column<string>(maxLength: 40, nullable: false),
Phone = table.Column<string>(maxLength: 24, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Shippers", x => x.ShipperID);
});
migrationBuilder.CreateTable(
name: "Suppliers",
columns: table => new
{
SupplierID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CompanyName = table.Column<string>(maxLength: 40, nullable: false),
ContactName = table.Column<string>(maxLength: 30, nullable: true),
ContactTitle = table.Column<string>(maxLength: 30, nullable: true),
Address = table.Column<string>(maxLength: 60, nullable: true),
City = table.Column<string>(maxLength: 15, nullable: true),
Region = table.Column<string>(maxLength: 15, nullable: true),
PostalCode = table.Column<string>(maxLength: 10, nullable: true),
Country = table.Column<string>(maxLength: 15, nullable: true),
Phone = table.Column<string>(maxLength: 24, nullable: true),
Fax = table.Column<string>(maxLength: 24, nullable: true),
HomePage = table.Column<string>(type: "ntext", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Suppliers", x => x.SupplierID);
});
migrationBuilder.CreateTable(
name: "CustomerCustomerDemo",
columns: table => new
{
CustomerID = table.Column<string>(fixedLength: true, maxLength: 5, nullable: false),
CustomerTypeID = table.Column<string>(fixedLength: true, maxLength: 10, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomerCustomerDemo", x => new { x.CustomerID, x.CustomerTypeID })
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_CustomerCustomerDemo_Customers",
column: x => x.CustomerID,
principalTable: "Customers",
principalColumn: "CustomerID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_CustomerCustomerDemo",
column: x => x.CustomerTypeID,
principalTable: "CustomerDemographics",
principalColumn: "CustomerTypeID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Territories",
columns: table => new
{
TerritoryID = table.Column<string>(maxLength: 20, nullable: false),
TerritoryDescription = table.Column<string>(fixedLength: true, maxLength: 50, nullable: false),
RegionID = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Territories", x => x.TerritoryID)
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_Territories_Region",
column: x => x.RegionID,
principalTable: "Region",
principalColumn: "RegionID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Orders",
columns: table => new
{
OrderID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CustomerID = table.Column<string>(fixedLength: true, maxLength: 5, nullable: true),
EmployeeID = table.Column<int>(nullable: true),
OrderDate = table.Column<DateTime>(type: "datetime", nullable: true),
RequiredDate = table.Column<DateTime>(type: "datetime", nullable: true),
ShippedDate = table.Column<DateTime>(type: "datetime", nullable: true),
ShipVia = table.Column<int>(nullable: true),
Freight = table.Column<decimal>(type: "money", nullable: true, defaultValueSql: "((0))"),
ShipName = table.Column<string>(maxLength: 40, nullable: true),
ShipAddress = table.Column<string>(maxLength: 60, nullable: true),
ShipCity = table.Column<string>(maxLength: 15, nullable: true),
ShipRegion = table.Column<string>(maxLength: 15, nullable: true),
ShipPostalCode = table.Column<string>(maxLength: 10, nullable: true),
ShipCountry = table.Column<string>(maxLength: 15, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Orders", x => x.OrderID);
table.ForeignKey(
name: "FK_Orders_Customers",
column: x => x.CustomerID,
principalTable: "Customers",
principalColumn: "CustomerID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Orders_Employees",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "EmployeeID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Orders_Shippers",
column: x => x.ShipVia,
principalTable: "Shippers",
principalColumn: "ShipperID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Products",
columns: table => new
{
ProductID = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ProductName = table.Column<string>(maxLength: 40, nullable: false),
SupplierID = table.Column<int>(nullable: true),
CategoryID = table.Column<int>(nullable: true),
QuantityPerUnit = table.Column<string>(maxLength: 20, nullable: true),
UnitPrice = table.Column<decimal>(type: "money", nullable: true, defaultValueSql: "((0))"),
UnitsInStock = table.Column<short>(nullable: true, defaultValueSql: "((0))"),
UnitsOnOrder = table.Column<short>(nullable: true, defaultValueSql: "((0))"),
ReorderLevel = table.Column<short>(nullable: true, defaultValueSql: "((0))"),
Discontinued = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.ProductID);
table.ForeignKey(
name: "FK_Products_Categories",
column: x => x.CategoryID,
principalTable: "Categories",
principalColumn: "CategoryID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Products_Suppliers",
column: x => x.SupplierID,
principalTable: "Suppliers",
principalColumn: "SupplierID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "EmployeeTerritories",
columns: table => new
{
EmployeeID = table.Column<int>(nullable: false),
TerritoryID = table.Column<string>(maxLength: 20, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeTerritories", x => new { x.EmployeeID, x.TerritoryID })
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_EmployeeTerritories_Employees",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "EmployeeID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_EmployeeTerritories_Territories",
column: x => x.TerritoryID,
principalTable: "Territories",
principalColumn: "TerritoryID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Order Details",
columns: table => new
{
OrderID = table.Column<int>(nullable: false),
ProductID = table.Column<int>(nullable: false),
UnitPrice = table.Column<decimal>(type: "money", nullable: false),
Quantity = table.Column<short>(nullable: false, defaultValueSql: "((1))"),
Discount = table.Column<float>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Order_Details", x => new { x.OrderID, x.ProductID });
table.ForeignKey(
name: "FK_Order_Details_Orders",
column: x => x.OrderID,
principalTable: "Orders",
principalColumn: "OrderID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Order_Details_Products",
column: x => x.ProductID,
principalTable: "Products",
principalColumn: "ProductID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_CustomerCustomerDemo_CustomerTypeID",
table: "CustomerCustomerDemo",
column: "CustomerTypeID");
migrationBuilder.CreateIndex(
name: "IX_Employees_ReportsTo",
table: "Employees",
column: "ReportsTo");
migrationBuilder.CreateIndex(
name: "IX_EmployeeTerritories_TerritoryID",
table: "EmployeeTerritories",
column: "TerritoryID");
migrationBuilder.CreateIndex(
name: "IX_Order Details_ProductID",
table: "Order Details",
column: "ProductID");
migrationBuilder.CreateIndex(
name: "IX_Orders_CustomerID",
table: "Orders",
column: "CustomerID");
migrationBuilder.CreateIndex(
name: "IX_Orders_EmployeeID",
table: "Orders",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_Orders_ShipVia",
table: "Orders",
column: "ShipVia");
migrationBuilder.CreateIndex(
name: "IX_Products_CategoryID",
table: "Products",
column: "CategoryID");
migrationBuilder.CreateIndex(
name: "IX_Products_SupplierID",
table: "Products",
column: "SupplierID");
migrationBuilder.CreateIndex(
name: "IX_Territories_RegionID",
table: "Territories",
column: "RegionID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomerCustomerDemo");
migrationBuilder.DropTable(
name: "EmployeeTerritories");
migrationBuilder.DropTable(
name: "Order Details");
migrationBuilder.DropTable(
name: "CustomerDemographics");
migrationBuilder.DropTable(
name: "Territories");
migrationBuilder.DropTable(
name: "Orders");
migrationBuilder.DropTable(
name: "Products");
migrationBuilder.DropTable(
name: "Region");
migrationBuilder.DropTable(
name: "Customers");
migrationBuilder.DropTable(
name: "Employees");
migrationBuilder.DropTable(
name: "Shippers");
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "Suppliers");
}
}
}

Просмотреть файл

@ -0,0 +1,613 @@
// <auto-generated />
using System;
using DatabaseFirstNorthwind;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DatabaseFirstNorthwind.Migrations
{
[DbContext(typeof(NorthwindContext))]
[Migration("20200723142842_SeedData")]
partial class SeedData
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DatabaseFirstNorthwind.Category", b =>
{
b.Property<int>("CategoryId")
.ValueGeneratedOnAdd()
.HasColumnName("CategoryID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CategoryName")
.IsRequired()
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<byte[]>("Picture")
.HasColumnType("image");
b.HasKey("CategoryId");
b.ToTable("Categories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Customer", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("CustomerId");
b.ToTable("Customers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.HasKey("CustomerId", "CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("CustomerTypeId");
b.ToTable("CustomerCustomerDemo");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerDemographics", b =>
{
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.Property<string>("CustomerDesc")
.HasColumnType("ntext");
b.HasKey("CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("CustomerDemographics");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.Property<int>("EmployeeId")
.ValueGeneratedOnAdd()
.HasColumnName("EmployeeID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<DateTime?>("BirthDate")
.HasColumnType("datetime");
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Extension")
.HasColumnType("nvarchar(4)")
.HasMaxLength(4);
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<DateTime?>("HireDate")
.HasColumnType("datetime");
b.Property<string>("HomePhone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<string>("Notes")
.HasColumnType("ntext");
b.Property<byte[]>("Photo")
.HasColumnType("image");
b.Property<string>("PhotoPath")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ReportsTo")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("TitleOfCourtesy")
.HasColumnType("nvarchar(25)")
.HasMaxLength(25);
b.HasKey("EmployeeId");
b.HasIndex("ReportsTo");
b.ToTable("Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.Property<int>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.HasKey("EmployeeId", "TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("TerritoryId");
b.ToTable("EmployeeTerritories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnName("OrderID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<int?>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<decimal?>("Freight")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<DateTime?>("OrderDate")
.HasColumnType("datetime");
b.Property<DateTime?>("RequiredDate")
.HasColumnType("datetime");
b.Property<string>("ShipAddress")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("ShipCity")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipCountry")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipName")
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ShipPostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("ShipRegion")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ShipVia")
.HasColumnType("int");
b.Property<DateTime?>("ShippedDate")
.HasColumnType("datetime");
b.HasKey("OrderId");
b.HasIndex("CustomerId");
b.HasIndex("EmployeeId");
b.HasIndex("ShipVia");
b.ToTable("Orders");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.Property<int>("OrderId")
.HasColumnName("OrderID")
.HasColumnType("int");
b.Property<int>("ProductId")
.HasColumnName("ProductID")
.HasColumnType("int");
b.Property<float>("Discount")
.HasColumnType("real");
b.Property<short>("Quantity")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((1))");
b.Property<decimal>("UnitPrice")
.HasColumnType("money");
b.HasKey("OrderId", "ProductId")
.HasName("PK_Order_Details");
b.HasIndex("ProductId");
b.ToTable("Order Details");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.Property<int>("ProductId")
.ValueGeneratedOnAdd()
.HasColumnName("ProductID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("CategoryId")
.HasColumnName("CategoryID")
.HasColumnType("int");
b.Property<bool>("Discontinued")
.HasColumnType("bit");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("QuantityPerUnit")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<short?>("ReorderLevel")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<int?>("SupplierId")
.HasColumnName("SupplierID")
.HasColumnType("int");
b.Property<decimal?>("UnitPrice")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsInStock")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsOnOrder")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.HasKey("ProductId");
b.HasIndex("CategoryId");
b.HasIndex("SupplierId");
b.ToTable("Products");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Region", b =>
{
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("RegionDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("RegionId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("Region");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Shipper", b =>
{
b.Property<int>("ShipperId")
.ValueGeneratedOnAdd()
.HasColumnName("ShipperID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.HasKey("ShipperId");
b.ToTable("Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Supplier", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnName("SupplierID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("HomePage")
.HasColumnType("ntext");
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("SupplierId");
b.ToTable("Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("TerritoryDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("RegionId");
b.ToTable("Territories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_CustomerCustomerDemo_Customers")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.CustomerDemographics", "CustomerType")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerTypeId")
.HasConstraintName("FK_CustomerCustomerDemo")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Manager")
.WithMany("DirectReports")
.HasForeignKey("ReportsTo")
.HasConstraintName("FK_Employees_Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("EmployeeTerritories")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_EmployeeTerritories_Employees")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Territory", "Territory")
.WithMany("EmployeeTerritories")
.HasForeignKey("TerritoryId")
.HasConstraintName("FK_EmployeeTerritories_Territories")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("Orders")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_Orders_Customers");
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("Orders")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_Orders_Employees");
b.HasOne("DatabaseFirstNorthwind.Shipper", "Shipper")
.WithMany("Orders")
.HasForeignKey("ShipVia")
.HasConstraintName("FK_Orders_Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.HasOne("DatabaseFirstNorthwind.Order", "Order")
.WithMany("OrderDetails")
.HasForeignKey("OrderId")
.HasConstraintName("FK_Order_Details_Orders")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Product", "Product")
.WithMany("OrderDetails")
.HasForeignKey("ProductId")
.HasConstraintName("FK_Order_Details_Products")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.HasOne("DatabaseFirstNorthwind.Category", "Category")
.WithMany("Products")
.HasForeignKey("CategoryId")
.HasConstraintName("FK_Products_Categories");
b.HasOne("DatabaseFirstNorthwind.Supplier", "Supplier")
.WithMany("Products")
.HasForeignKey("SupplierId")
.HasConstraintName("FK_Products_Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Region", "Region")
.WithMany("Territories")
.HasForeignKey("RegionId")
.HasConstraintName("FK_Territories_Region")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

Просмотреть файл

@ -0,0 +1,18 @@
using DatabaseFirstNorthwind.Properties;
using Microsoft.EntityFrameworkCore.Migrations;
namespace DatabaseFirstNorthwind.Migrations
{
public partial class SeedData : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(Resources.ResourceManager.GetString("SeedData_Up"));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(Resources.ResourceManager.GetString("SeedData_Down"));
}
}
}

Просмотреть файл

@ -0,0 +1,611 @@
// <auto-generated />
using System;
using DatabaseFirstNorthwind;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DatabaseFirstNorthwind.Migrations
{
[DbContext(typeof(NorthwindContext))]
partial class NorthwindContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DatabaseFirstNorthwind.Category", b =>
{
b.Property<int>("CategoryId")
.ValueGeneratedOnAdd()
.HasColumnName("CategoryID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CategoryName")
.IsRequired()
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Description")
.HasColumnType("ntext");
b.Property<byte[]>("Picture")
.HasColumnType("image");
b.HasKey("CategoryId");
b.ToTable("Categories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Customer", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("CustomerId");
b.ToTable("Customers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.HasKey("CustomerId", "CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("CustomerTypeId");
b.ToTable("CustomerCustomerDemo");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerDemographics", b =>
{
b.Property<string>("CustomerTypeId")
.HasColumnName("CustomerTypeID")
.HasColumnType("nchar(10)")
.IsFixedLength(true)
.HasMaxLength(10);
b.Property<string>("CustomerDesc")
.HasColumnType("ntext");
b.HasKey("CustomerTypeId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("CustomerDemographics");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.Property<int>("EmployeeId")
.ValueGeneratedOnAdd()
.HasColumnName("EmployeeID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<DateTime?>("BirthDate")
.HasColumnType("datetime");
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Extension")
.HasColumnType("nvarchar(4)")
.HasMaxLength(4);
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<DateTime?>("HireDate")
.HasColumnType("datetime");
b.Property<string>("HomePhone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<string>("Notes")
.HasColumnType("ntext");
b.Property<byte[]>("Photo")
.HasColumnType("image");
b.Property<string>("PhotoPath")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ReportsTo")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("TitleOfCourtesy")
.HasColumnType("nvarchar(25)")
.HasMaxLength(25);
b.HasKey("EmployeeId");
b.HasIndex("ReportsTo");
b.ToTable("Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.Property<int>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.HasKey("EmployeeId", "TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("TerritoryId");
b.ToTable("EmployeeTerritories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnName("OrderID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CustomerId")
.HasColumnName("CustomerID")
.HasColumnType("nchar(5)")
.IsFixedLength(true)
.HasMaxLength(5);
b.Property<int?>("EmployeeId")
.HasColumnName("EmployeeID")
.HasColumnType("int");
b.Property<decimal?>("Freight")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<DateTime?>("OrderDate")
.HasColumnType("datetime");
b.Property<DateTime?>("RequiredDate")
.HasColumnType("datetime");
b.Property<string>("ShipAddress")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("ShipCity")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipCountry")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("ShipName")
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ShipPostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("ShipRegion")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<int?>("ShipVia")
.HasColumnType("int");
b.Property<DateTime?>("ShippedDate")
.HasColumnType("datetime");
b.HasKey("OrderId");
b.HasIndex("CustomerId");
b.HasIndex("EmployeeId");
b.HasIndex("ShipVia");
b.ToTable("Orders");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.Property<int>("OrderId")
.HasColumnName("OrderID")
.HasColumnType("int");
b.Property<int>("ProductId")
.HasColumnName("ProductID")
.HasColumnType("int");
b.Property<float>("Discount")
.HasColumnType("real");
b.Property<short>("Quantity")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((1))");
b.Property<decimal>("UnitPrice")
.HasColumnType("money");
b.HasKey("OrderId", "ProductId")
.HasName("PK_Order_Details");
b.HasIndex("ProductId");
b.ToTable("Order Details");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.Property<int>("ProductId")
.ValueGeneratedOnAdd()
.HasColumnName("ProductID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int?>("CategoryId")
.HasColumnName("CategoryID")
.HasColumnType("int");
b.Property<bool>("Discontinued")
.HasColumnType("bit");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("QuantityPerUnit")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<short?>("ReorderLevel")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<int?>("SupplierId")
.HasColumnName("SupplierID")
.HasColumnType("int");
b.Property<decimal?>("UnitPrice")
.ValueGeneratedOnAdd()
.HasColumnType("money")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsInStock")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.Property<short?>("UnitsOnOrder")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValueSql("((0))");
b.HasKey("ProductId");
b.HasIndex("CategoryId");
b.HasIndex("SupplierId");
b.ToTable("Products");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Region", b =>
{
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("RegionDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("RegionId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("Region");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Shipper", b =>
{
b.Property<int>("ShipperId")
.ValueGeneratedOnAdd()
.HasColumnName("ShipperID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.HasKey("ShipperId");
b.ToTable("Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Supplier", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnName("SupplierID")
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(60)")
.HasMaxLength(60);
b.Property<string>("City")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("CompanyName")
.IsRequired()
.HasColumnType("nvarchar(40)")
.HasMaxLength(40);
b.Property<string>("ContactName")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("ContactTitle")
.HasColumnType("nvarchar(30)")
.HasMaxLength(30);
b.Property<string>("Country")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.Property<string>("Fax")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("HomePage")
.HasColumnType("ntext");
b.Property<string>("Phone")
.HasColumnType("nvarchar(24)")
.HasMaxLength(24);
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(10)")
.HasMaxLength(10);
b.Property<string>("Region")
.HasColumnType("nvarchar(15)")
.HasMaxLength(15);
b.HasKey("SupplierId");
b.ToTable("Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.Property<string>("TerritoryId")
.HasColumnName("TerritoryID")
.HasColumnType("nvarchar(20)")
.HasMaxLength(20);
b.Property<int>("RegionId")
.HasColumnName("RegionID")
.HasColumnType("int");
b.Property<string>("TerritoryDescription")
.IsRequired()
.HasColumnType("nchar(50)")
.IsFixedLength(true)
.HasMaxLength(50);
b.HasKey("TerritoryId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("RegionId");
b.ToTable("Territories");
});
modelBuilder.Entity("DatabaseFirstNorthwind.CustomerCustomerDemo", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_CustomerCustomerDemo_Customers")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.CustomerDemographics", "CustomerType")
.WithMany("CustomerCustomerDemo")
.HasForeignKey("CustomerTypeId")
.HasConstraintName("FK_CustomerCustomerDemo")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Employee", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Manager")
.WithMany("DirectReports")
.HasForeignKey("ReportsTo")
.HasConstraintName("FK_Employees_Employees");
});
modelBuilder.Entity("DatabaseFirstNorthwind.EmployeeTerritory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("EmployeeTerritories")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_EmployeeTerritories_Employees")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Territory", "Territory")
.WithMany("EmployeeTerritories")
.HasForeignKey("TerritoryId")
.HasConstraintName("FK_EmployeeTerritories_Territories")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Order", b =>
{
b.HasOne("DatabaseFirstNorthwind.Customer", "Customer")
.WithMany("Orders")
.HasForeignKey("CustomerId")
.HasConstraintName("FK_Orders_Customers");
b.HasOne("DatabaseFirstNorthwind.Employee", "Employee")
.WithMany("Orders")
.HasForeignKey("EmployeeId")
.HasConstraintName("FK_Orders_Employees");
b.HasOne("DatabaseFirstNorthwind.Shipper", "Shipper")
.WithMany("Orders")
.HasForeignKey("ShipVia")
.HasConstraintName("FK_Orders_Shippers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.OrderDetail", b =>
{
b.HasOne("DatabaseFirstNorthwind.Order", "Order")
.WithMany("OrderDetails")
.HasForeignKey("OrderId")
.HasConstraintName("FK_Order_Details_Orders")
.IsRequired();
b.HasOne("DatabaseFirstNorthwind.Product", "Product")
.WithMany("OrderDetails")
.HasForeignKey("ProductId")
.HasConstraintName("FK_Order_Details_Products")
.IsRequired();
});
modelBuilder.Entity("DatabaseFirstNorthwind.Product", b =>
{
b.HasOne("DatabaseFirstNorthwind.Category", "Category")
.WithMany("Products")
.HasForeignKey("CategoryId")
.HasConstraintName("FK_Products_Categories");
b.HasOne("DatabaseFirstNorthwind.Supplier", "Supplier")
.WithMany("Products")
.HasForeignKey("SupplierId")
.HasConstraintName("FK_Products_Suppliers");
});
modelBuilder.Entity("DatabaseFirstNorthwind.Territory", b =>
{
b.HasOne("DatabaseFirstNorthwind.Region", "Region")
.WithMany("Territories")
.HasForeignKey("RegionId")
.HasConstraintName("FK_Territories_Region")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
DELETE FROM [dbo].[EmployeeTerritories]
DELETE FROM [dbo].[Territories]
DELETE FROM [dbo].[Region]
DELETE FROM [dbo].[Order Details]
DELETE FROM [dbo].[Orders]
DELETE FROM [dbo].[Employees]
DELETE FROM [dbo].[Products]
DELETE FROM [dbo].[Categories]
DELETE FROM [dbo].[Shippers]
DELETE FROM [dbo].[Suppliers]
DELETE FROM [dbo].[Customers]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class AlphabeticalListOfProducts
{
[Column("ProductID")]
public int ProductId { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[Column("SupplierID")]
public int? SupplierId { get; set; }
[Column("CategoryID")]
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; }
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Category
{
public Category()
{
Products = new HashSet<Product>();
}
[Key]
[Column("CategoryID")]
public int CategoryId { get; set; }
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
[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,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class CategorySalesFor1997
{
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
[Column(TypeName = "money")]
public decimal? CategorySales { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class CurrentProductList
{
[Column("ProductID")]
public int ProductId { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Customer
{
public Customer()
{
CustomerCustomerDemo = new HashSet<CustomerCustomerDemo>();
Orders = new HashSet<Order>();
}
[Key]
[Column("CustomerID")]
[StringLength(5)]
public string CustomerId { get; set; }
[Required]
[StringLength(40)]
public string CompanyName { get; set; }
[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")]
public virtual ICollection<CustomerCustomerDemo> CustomerCustomerDemo { get; set; }
[InverseProperty("Customer")]
public virtual ICollection<Order> Orders { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class CustomerAndSuppliersByCity
{
[StringLength(15)]
public string City { get; set; }
[Required]
[StringLength(40)]
public string CompanyName { get; set; }
[StringLength(30)]
public string ContactName { get; set; }
[Required]
[StringLength(9)]
public string Relationship { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class CustomerCustomerDemo
{
[Key]
[Column("CustomerID")]
[StringLength(5)]
public string CustomerId { get; set; }
[Key]
[Column("CustomerTypeID")]
[StringLength(10)]
public string CustomerTypeId { get; set; }
[ForeignKey(nameof(CustomerId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Customer.CustomerCustomerDemo))]
public virtual Customer Customer { get; set; }
[ForeignKey(nameof(CustomerTypeId))]
[InverseProperty(nameof(CustomerDemographics.CustomerCustomerDemo))]
public virtual CustomerDemographics CustomerType { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class CustomerDemographics
{
public CustomerDemographics()
{
CustomerCustomerDemo = new HashSet<CustomerCustomerDemo>();
}
[Key]
[Column("CustomerTypeID")]
[StringLength(10)]
public string CustomerTypeId { get; set; }
[Column(TypeName = "ntext")]
public string CustomerDesc { get; set; }
[InverseProperty("CustomerType")]
public virtual ICollection<CustomerCustomerDemo> CustomerCustomerDemo { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Employee
{
public Employee()
{
EmployeeTerritories = new HashSet<EmployeeTerritory>();
DirectReports = new HashSet<Employee>();
Orders = new HashSet<Order>();
}
[Key]
[Column("EmployeeID")]
public int EmployeeId { get; set; }
[Required]
[StringLength(20)]
public string LastName { get; set; }
[Required]
[StringLength(10)]
public string FirstName { get; set; }
[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(nameof(ReportsTo))]
[InverseProperty("DirectReports")]
public virtual Employee Manager { get; set; }
[InverseProperty("Employee")]
public virtual ICollection<EmployeeTerritory> EmployeeTerritories { get; set; }
[InverseProperty("Manager")]
public virtual ICollection<Employee> DirectReports { get; set; }
[InverseProperty("Employee")]
public virtual ICollection<Order> Orders { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class EmployeeTerritory
{
[Key]
[Column("EmployeeID")]
public int EmployeeId { get; set; }
[Key]
[Column("TerritoryID")]
[StringLength(20)]
public string TerritoryId { get; set; }
[ForeignKey(nameof(EmployeeId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Employee.EmployeeTerritories))]
public virtual Employee Employee { get; set; }
[ForeignKey(nameof(TerritoryId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Territory.EmployeeTerritories))]
public virtual Territory Territory { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Invoices
{
[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; }
[Required]
[StringLength(40)]
public string CustomerName { 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; }
[Required]
[StringLength(31)]
public string Salesperson { get; set; }
[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; }
[Required]
[StringLength(40)]
public string ShipperName { get; set; }
[Column("ProductID")]
public int ProductId { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[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,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Order
{
public Order()
{
OrderDetails = new HashSet<OrderDetail>();
}
[Key]
[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; }
[ForeignKey(nameof(CustomerId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Customer.Orders))]
public virtual Customer Customer { get; set; }
[ForeignKey(nameof(EmployeeId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Employee.Orders))]
public virtual Employee Employee { get; set; }
[ForeignKey(nameof(ShipVia))]
public virtual Shipper Shipper { get; set; }
[InverseProperty("Order")]
public virtual ICollection<OrderDetail> OrderDetails { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
[Table("Order Details")]
public partial class OrderDetail
{
[Key]
[Column("OrderID")]
public int OrderId { get; set; }
[Key]
[Column("ProductID")]
public int ProductId { get; set; }
[Column(TypeName = "money")]
public decimal UnitPrice { get; set; }
public short Quantity { get; set; }
public float Discount { get; set; }
[ForeignKey(nameof(OrderId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Order.OrderDetails))]
public virtual Order Order { get; set; }
[ForeignKey(nameof(ProductId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Product.OrderDetails))]
public virtual Product Product { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class OrderDetailsExtended
{
[Column("OrderID")]
public int OrderId { get; set; }
[Column("ProductID")]
public int ProductId { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[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,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class OrderSubtotals
{
[Column("OrderID")]
public int OrderId { get; set; }
[Column(TypeName = "money")]
public decimal? Subtotal { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
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; }
[Required]
[StringLength(40)]
public string CompanyName { 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; }
}
}

Просмотреть файл

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Product
{
public Product()
{
OrderDetails = new HashSet<OrderDetail>();
}
[Key]
[Column("ProductID")]
public int ProductId { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[Column("SupplierID")]
public int? SupplierId { get; set; }
[Column("CategoryID")]
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(nameof(CategoryId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Category.Products))]
public virtual Category Category { get; set; }
[ForeignKey(nameof(SupplierId))]
[InverseProperty(nameof(DatabaseFirstNorthwind.Supplier.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;
namespace DatabaseFirstNorthwind
{
public partial class ProductSalesFor1997
{
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[Column(TypeName = "money")]
public decimal? ProductSales { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class ProductsAboveAveragePrice
{
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[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;
namespace DatabaseFirstNorthwind
{
public partial class ProductsByCategory
{
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[StringLength(20)]
public string QuantityPerUnit { get; set; }
public short? UnitsInStock { get; set; }
public bool Discontinued { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class QuarterlyOrders
{
[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,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Region
{
public Region()
{
Territories = new HashSet<Territory>();
}
[Key]
[Column("RegionID")]
public int RegionId { get; set; }
[Required]
[StringLength(50)]
public string RegionDescription { get; set; }
[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;
namespace DatabaseFirstNorthwind
{
public partial class SalesByCategory
{
[Column("CategoryID")]
public int CategoryId { get; set; }
[Required]
[StringLength(15)]
public string CategoryName { get; set; }
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[Column(TypeName = "money")]
public decimal? ProductSales { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class SalesTotalsByAmount
{
[Column(TypeName = "money")]
public decimal? SaleAmount { get; set; }
[Column("OrderID")]
public int OrderId { get; set; }
[Required]
[StringLength(40)]
public string CompanyName { get; set; }
[Column(TypeName = "datetime")]
public DateTime? ShippedDate { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Shipper
{
public Shipper()
{
Orders = new HashSet<Order>();
}
[Key]
[Column("ShipperID")]
public int ShipperId { get; set; }
[Required]
[StringLength(40)]
public string CompanyName { get; set; }
[StringLength(24)]
public string Phone { get; set; }
[InverseProperty("Shipper")]
public virtual ICollection<Order> Orders { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
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,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
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,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Supplier
{
public Supplier()
{
Products = new HashSet<Product>();
}
[Key]
[Column("SupplierID")]
public int SupplierId { get; set; }
[Required]
[StringLength(40)]
public string CompanyName { get; set; }
[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,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DatabaseFirstNorthwind
{
public partial class Territory
{
public Territory()
{
EmployeeTerritories = new HashSet<EmployeeTerritory>();
}
[Key]
[Column("TerritoryID")]
[StringLength(20)]
public string TerritoryId { get; set; }
[Required]
[StringLength(50)]
public string TerritoryDescription { get; set; }
[Column("RegionID")]
public int RegionId { get; set; }
[ForeignKey(nameof(RegionId))]
[InverseProperty("Territories")]
public virtual Region Region { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<EmployeeTerritory> EmployeeTerritories { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,333 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
namespace DatabaseFirstNorthwind
{
public partial class NorthwindContext : DbContext
{
public NorthwindContext()
{
}
public NorthwindContext(DbContextOptions<NorthwindContext> options)
: base(options)
{
}
public virtual DbSet<AlphabeticalListOfProducts> AlphabeticalListOfProducts { get; set; }
public virtual DbSet<Category> Categories { get; set; }
public virtual DbSet<CategorySalesFor1997> CategorySalesFor1997 { get; set; }
public virtual DbSet<CurrentProductList> CurrentProductList { get; set; }
public virtual DbSet<CustomerAndSuppliersByCity> CustomerAndSuppliersByCity { get; set; }
public virtual DbSet<CustomerCustomerDemo> CustomerCustomerDemo { get; set; }
public virtual DbSet<CustomerDemographics> CustomerDemographics { get; set; }
public virtual DbSet<Customer> Customers { get; set; }
public virtual DbSet<EmployeeTerritory> EmployeeTerritories { get; set; }
public virtual DbSet<Employee> Employees { get; set; }
public virtual DbSet<Invoices> Invoices { get; set; }
public virtual DbSet<OrderDetail> OrderDetails { get; set; }
public virtual DbSet<OrderDetailsExtended> OrderDetailsExtended { get; set; }
public virtual DbSet<OrderSubtotals> OrderSubtotals { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<OrdersQry> OrdersQry { get; set; }
public virtual DbSet<ProductSalesFor1997> ProductSalesFor1997 { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<ProductsAboveAveragePrice> ProductsAboveAveragePrice { get; set; }
public virtual DbSet<ProductsByCategory> ProductsByCategory { get; set; }
public virtual DbSet<QuarterlyOrders> QuarterlyOrders { get; set; }
public virtual DbSet<Region> Region { get; set; }
public virtual DbSet<SalesByCategory> SalesByCategory { get; set; }
public virtual DbSet<SalesTotalsByAmount> SalesTotalsByAmount { get; set; }
public virtual DbSet<Shipper> Shippers { get; set; }
public virtual DbSet<SummaryOfSalesByQuarter> SummaryOfSalesByQuarter { get; set; }
public virtual DbSet<SummaryOfSalesByYear> SummaryOfSalesByYear { get; set; }
public virtual DbSet<Supplier> Suppliers { get; set; }
public virtual DbSet<Territory> Territories { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer("Server=.\\SQLEXPRESS;Database=Northwind;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<AlphabeticalListOfProducts>(entity =>
{
entity.HasNoKey();
entity.ToView("Alphabetical list of products");
});
modelBuilder.Entity<CategorySalesFor1997>(entity =>
{
entity.HasNoKey();
entity.ToView("Category Sales for 1997");
});
modelBuilder.Entity<CurrentProductList>(entity =>
{
entity.HasNoKey();
entity.ToView("Current Product List");
entity.Property(e => e.ProductId).ValueGeneratedOnAdd();
});
modelBuilder.Entity<CustomerAndSuppliersByCity>(entity =>
{
entity.HasNoKey();
entity.ToView("Customer and Suppliers by City");
entity.Property(e => e.Relationship).IsUnicode(false);
});
modelBuilder.Entity<CustomerCustomerDemo>(entity =>
{
entity.HasKey(e => new { e.CustomerId, e.CustomerTypeId })
.IsClustered(false);
entity.Property(e => e.CustomerId).IsFixedLength();
entity.Property(e => e.CustomerTypeId).IsFixedLength();
entity.HasOne(d => d.Customer)
.WithMany(p => p.CustomerCustomerDemo)
.HasForeignKey(d => d.CustomerId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_CustomerCustomerDemo_Customers");
entity.HasOne(d => d.CustomerType)
.WithMany(p => p.CustomerCustomerDemo)
.HasForeignKey(d => d.CustomerTypeId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_CustomerCustomerDemo");
});
modelBuilder.Entity<CustomerDemographics>(entity =>
{
entity.HasKey(e => e.CustomerTypeId)
.IsClustered(false);
entity.Property(e => e.CustomerTypeId).IsFixedLength();
});
modelBuilder.Entity<Customer>(entity =>
{
entity.Property(e => e.CustomerId).IsFixedLength();
});
modelBuilder.Entity<EmployeeTerritory>(entity =>
{
entity.HasKey(e => new { e.EmployeeId, e.TerritoryId })
.IsClustered(false);
entity.HasOne(d => d.Employee)
.WithMany(p => p.EmployeeTerritories)
.HasForeignKey(d => d.EmployeeId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_EmployeeTerritories_Employees");
entity.HasOne(d => d.Territory)
.WithMany(p => p.EmployeeTerritories)
.HasForeignKey(d => d.TerritoryId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_EmployeeTerritories_Territories");
});
modelBuilder.Entity<Employee>(entity =>
{
entity.HasOne(d => d.Manager)
.WithMany(p => p.DirectReports)
.HasForeignKey(d => d.ReportsTo)
.HasConstraintName("FK_Employees_Employees");
});
modelBuilder.Entity<Invoices>(entity =>
{
entity.HasNoKey();
entity.ToView("Invoices");
entity.Property(e => e.CustomerId).IsFixedLength();
});
modelBuilder.Entity<OrderDetail>(entity =>
{
entity.HasKey(e => new { e.OrderId, e.ProductId })
.HasName("PK_Order_Details");
entity.Property(e => e.Quantity).HasDefaultValueSql("((1))");
entity.HasOne(d => d.Order)
.WithMany(p => p.OrderDetails)
.HasForeignKey(d => d.OrderId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Order_Details_Orders");
entity.HasOne(d => d.Product)
.WithMany(p => p.OrderDetails)
.HasForeignKey(d => d.ProductId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Order_Details_Products");
});
modelBuilder.Entity<OrderDetailsExtended>(entity =>
{
entity.HasNoKey();
entity.ToView("Order Details Extended");
});
modelBuilder.Entity<OrderSubtotals>(entity =>
{
entity.HasNoKey();
entity.ToView("Order Subtotals");
});
modelBuilder.Entity<Order>(entity =>
{
entity.Property(e => e.CustomerId).IsFixedLength();
entity.Property(e => e.Freight).HasDefaultValueSql("((0))");
entity.HasOne(d => d.Customer)
.WithMany(p => p.Orders)
.HasForeignKey(d => d.CustomerId)
.HasConstraintName("FK_Orders_Customers");
entity.HasOne(d => d.Employee)
.WithMany(p => p.Orders)
.HasForeignKey(d => d.EmployeeId)
.HasConstraintName("FK_Orders_Employees");
entity.HasOne(d => d.Shipper)
.WithMany(p => p.Orders)
.HasForeignKey(d => d.ShipVia)
.HasConstraintName("FK_Orders_Shippers");
});
modelBuilder.Entity<OrdersQry>(entity =>
{
entity.HasNoKey();
entity.ToView("Orders Qry");
entity.Property(e => e.CustomerId).IsFixedLength();
});
modelBuilder.Entity<ProductSalesFor1997>(entity =>
{
entity.HasNoKey();
entity.ToView("Product Sales for 1997");
});
modelBuilder.Entity<Product>(entity =>
{
entity.Property(e => e.ReorderLevel).HasDefaultValueSql("((0))");
entity.Property(e => e.UnitPrice).HasDefaultValueSql("((0))");
entity.Property(e => e.UnitsInStock).HasDefaultValueSql("((0))");
entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("((0))");
entity.HasOne(d => d.Category)
.WithMany(p => p.Products)
.HasForeignKey(d => d.CategoryId)
.HasConstraintName("FK_Products_Categories");
entity.HasOne(d => d.Supplier)
.WithMany(p => p.Products)
.HasForeignKey(d => d.SupplierId)
.HasConstraintName("FK_Products_Suppliers");
});
modelBuilder.Entity<ProductsAboveAveragePrice>(entity =>
{
entity.HasNoKey();
entity.ToView("Products Above Average Price");
});
modelBuilder.Entity<ProductsByCategory>(entity =>
{
entity.HasNoKey();
entity.ToView("Products by Category");
});
modelBuilder.Entity<QuarterlyOrders>(entity =>
{
entity.HasNoKey();
entity.ToView("Quarterly Orders");
entity.Property(e => e.CustomerId).IsFixedLength();
});
modelBuilder.Entity<Region>(entity =>
{
entity.HasKey(e => e.RegionId)
.IsClustered(false);
entity.Property(e => e.RegionId).ValueGeneratedNever();
entity.Property(e => e.RegionDescription).IsFixedLength();
});
modelBuilder.Entity<SalesByCategory>(entity =>
{
entity.HasNoKey();
entity.ToView("Sales by Category");
});
modelBuilder.Entity<SalesTotalsByAmount>(entity =>
{
entity.HasNoKey();
entity.ToView("Sales Totals by Amount");
});
modelBuilder.Entity<SummaryOfSalesByQuarter>(entity =>
{
entity.HasNoKey();
entity.ToView("Summary of Sales by Quarter");
});
modelBuilder.Entity<SummaryOfSalesByYear>(entity =>
{
entity.HasNoKey();
entity.ToView("Summary of Sales by Year");
});
modelBuilder.Entity<Territory>(entity =>
{
entity.HasKey(e => e.TerritoryId)
.IsClustered(false);
entity.Property(e => e.TerritoryDescription).IsFixedLength();
entity.HasOne(d => d.Region)
.WithMany(p => p.Territories)
.HasForeignKey(d => d.RegionId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Territories_Region");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}

Просмотреть файл

@ -0,0 +1,93 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DatabaseFirstNorthwind.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DatabaseFirstNorthwind.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to DELETE FROM [dbo].[EmployeeTerritories]
///DELETE FROM [dbo].[Territories]
///DELETE FROM [dbo].[Region]
///DELETE FROM [dbo].[Order Details]
///DELETE FROM [dbo].[Orders]
///DELETE FROM [dbo].[Employees]
///DELETE FROM [dbo].[Products]
///DELETE FROM [dbo].[Categories]
///DELETE FROM [dbo].[Shippers]
///DELETE FROM [dbo].[Suppliers]
///DELETE FROM [dbo].[Customers]
///.
/// </summary>
internal static string SeedData_Down {
get {
return ResourceManager.GetString("SeedData_Down", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to INSERT [dbo].[Customers] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City], [Region], [PostalCode], [Country], [Phone], [Fax]) VALUES (N&apos;ALFKI&apos;, N&apos;Alfreds Futterkiste&apos;, N&apos;Maria Anders&apos;, N&apos;Sales Representative&apos;, N&apos;Obere Str. 57&apos;, N&apos;Berlin&apos;, NULL, N&apos;12209&apos;, N&apos;Germany&apos;, N&apos;030-0074321&apos;, N&apos;030-0076545&apos;)
///INSERT [dbo].[Customers] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City], [Region], [PostalCode], [Country], [Phone], [Fax]) VALUES (N&apos;ANATR&apos;, N&apos;Ana Tr [rest of string was truncated]&quot;;.
/// </summary>
internal static string SeedData_Up {
get {
return ResourceManager.GetString("SeedData_Up", resourceCulture);
}
}
}
}

Просмотреть файл

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="SeedData_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\migrations\seeddata_down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="SeedData_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\migrations\seeddata_up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,14 @@
## DatabaseFirstNorthwind ##
This project demonstrates how to setup the RadEntityFrameworkCoreDataSource along with the RadGridView and RadDataPager to display the
data from the NorthWind database. To run the project, you can follow these steps:
1. Open SQL Server Management Studio and connect to your sql server.
2. Open the Package Manager Console(https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-powershell) in Visual Studio.
3. Type Update-Database and hit Enter. (If you already have a database named "Northwind", you have to delete it first)
Note, that you may need to update the connection string inside the OnConfiguring method in the NorthwindContext class, if you are not using SQLEXPRESS.
<keywords:databasefirst, entityframeworkcore>

Просмотреть файл

@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30309.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseFirstNorthwind_NetCore", "DatabaseFirstNorthwind\DatabaseFirstNorthwind_NetCore.csproj", "{05B682E6-E79D-47DE-ACAC-060BA44203BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{05B682E6-E79D-47DE-ACAC-060BA44203BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05B682E6-E79D-47DE-ACAC-060BA44203BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05B682E6-E79D-47DE-ACAC-060BA44203BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05B682E6-E79D-47DE-ACAC-060BA44203BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {618FCF0F-914D-460B-A57C-AB78AD98576F}
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = http://tfsemea.progress.com:8080/defaultcollection
SccLocalPath0 = .
SccProjectUniqueName1 = DatabaseFirstNorthwind\\DatabaseFirstNorthwind_NetCore.csproj
SccProjectName1 = DatabaseFirstNorthwind
SccLocalPath1 = DatabaseFirstNorthwind
EndGlobalSection
EndGlobal