-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from linq2db/master
Release 5.1.5
- Loading branch information
Showing
20 changed files
with
676 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...inqToDB.EntityFrameworkCore.SQLite.Tests/LinqToDB.EntityFrameworkCore.SQLite.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\Build\linq2db.Tests.props" /> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Models\UniversalEntities\**" /> | ||
<EmbeddedResource Remove="Models\UniversalEntities\**" /> | ||
<None Remove="Models\UniversalEntities\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Source\LinqToDB.EntityFrameworkCore\linq2db.EntityFrameworkCore.csproj" /> | ||
<ProjectReference Include="..\LinqToDB.EntityFrameworkCore.BaseTests\LinqToDB.EntityFrameworkCore.BaseTests.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Models\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
29 changes: 29 additions & 0 deletions
29
Tests/LinqToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/CategoriesMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class CategoriesMap : IEntityTypeConfiguration<Category> | ||
{ | ||
public void Configure(EntityTypeBuilder<Category> builder) | ||
{ | ||
|
||
builder.HasKey(e => e.CategoryId); | ||
|
||
builder.HasIndex(e => e.CategoryName) | ||
.HasDatabaseName("CategoryName"); | ||
|
||
builder.Property(e => e.CategoryId).HasColumnName("CategoryID") | ||
/*.ValueGeneratedNever()*/; | ||
|
||
builder.Property(e => e.CategoryName) | ||
.IsRequired() | ||
.HasMaxLength(15); | ||
|
||
builder.Property(e => e.Description).HasColumnType("text"); | ||
|
||
builder.Property(e => e.Picture).HasColumnType("blob"); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/CustomerCustomerDemoMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class CustomerCustomerDemoMap : IEntityTypeConfiguration<CustomerCustomerDemo> | ||
{ | ||
public void Configure(EntityTypeBuilder<CustomerCustomerDemo> builder) | ||
{ | ||
|
||
builder.HasKey(e => new { e.CustomerId, e.CustomerTypeId }); | ||
|
||
builder.Property(e => e.CustomerId) | ||
.HasColumnName("CustomerID") | ||
.HasMaxLength(5); | ||
|
||
builder.Property(e => e.CustomerTypeId) | ||
.HasColumnName("CustomerTypeID") | ||
.HasMaxLength(10); | ||
|
||
builder.HasOne(d => d.Customer) | ||
.WithMany(p => p.CustomerCustomerDemo) | ||
.HasForeignKey(d => d.CustomerId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_CustomerCustomerDemo_Customers"); | ||
|
||
builder.HasOne(d => d.CustomerType) | ||
.WithMany(p => p.CustomerCustomerDemo) | ||
.HasForeignKey(d => d.CustomerTypeId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_CustomerCustomerDemo"); | ||
|
||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/CustomerDemographicsMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class CustomerDemographicsMap : IEntityTypeConfiguration<CustomerDemographics> | ||
{ | ||
public void Configure(EntityTypeBuilder<CustomerDemographics> builder) | ||
{ | ||
builder.HasKey(e => e.CustomerTypeId); | ||
|
||
builder.Property(e => e.CustomerTypeId) | ||
.HasColumnName("CustomerTypeID") | ||
.HasMaxLength(10) | ||
.ValueGeneratedNever(); | ||
|
||
builder.Property(e => e.CustomerDesc).HasColumnType("text"); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
Tests/LinqToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/CustomersMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SqlServer.Tests.Models.Northwind.Mapping | ||
{ | ||
public class CustomersMap : IEntityTypeConfiguration<Customer> | ||
{ | ||
public void Configure(EntityTypeBuilder<Customer> builder) | ||
{ | ||
|
||
builder.HasKey(e => e.CustomerId); | ||
|
||
builder.HasIndex(e => e.City) | ||
.HasDatabaseName("City"); | ||
|
||
builder.HasIndex(e => e.CompanyName) | ||
.HasDatabaseName("Customer_CompanyName"); | ||
|
||
builder.HasIndex(e => e.PostalCode) | ||
.HasDatabaseName("Customer_Postal_ode"); | ||
|
||
builder.HasIndex(e => e.Region) | ||
.HasDatabaseName("Customer_Region"); | ||
|
||
builder.Property(e => e.CustomerId) | ||
.HasColumnName("CustomerID") | ||
.HasMaxLength(5) | ||
.ValueGeneratedNever(); | ||
|
||
builder.Property(e => e.Address).HasMaxLength(60); | ||
builder.Property(e => e.City).HasMaxLength(15); | ||
builder.Property(e => e.CompanyName) | ||
.IsRequired() | ||
.HasMaxLength(40); | ||
|
||
builder.Property(e => e.ContactName).HasMaxLength(30); | ||
builder.Property(e => e.ContactTitle).HasMaxLength(30); | ||
builder.Property(e => e.Country).HasMaxLength(15); | ||
builder.Property(e => e.Fax).HasMaxLength(24); | ||
builder.Property(e => e.Phone).HasMaxLength(24); | ||
builder.Property(e => e.PostalCode).HasMaxLength(10); | ||
builder.Property(e => e.Region).HasMaxLength(15); | ||
|
||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...qToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/EmployeeTerritoriesMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class EmployeeTerritoriesMap : IEntityTypeConfiguration<EmployeeTerritory> | ||
{ | ||
public void Configure(EntityTypeBuilder<EmployeeTerritory> builder) | ||
{ | ||
builder.HasKey(e => new { e.EmployeeId, e.TerritoryId }); | ||
|
||
builder.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); | ||
|
||
builder.Property(e => e.TerritoryId) | ||
.HasColumnName("TerritoryID") | ||
.HasMaxLength(20); | ||
|
||
builder.HasOne(d => d.Employee) | ||
.WithMany(p => p.EmployeeTerritories) | ||
.HasForeignKey(d => d.EmployeeId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_EmployeeTerritories_Employees"); | ||
|
||
builder.HasOne(d => d.Territory) | ||
.WithMany(p => p.EmployeeTerritories) | ||
.HasForeignKey(d => d.TerritoryId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_EmployeeTerritories_Territories"); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
Tests/LinqToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/EmployeesMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class EmployeesMap : IEntityTypeConfiguration<Employee> | ||
{ | ||
public void Configure(EntityTypeBuilder<Employee> builder) | ||
{ | ||
builder.HasKey(e => e.EmployeeId); | ||
|
||
builder.HasIndex(e => e.LastName) | ||
.HasDatabaseName("Employee_LastName"); | ||
|
||
builder.HasIndex(e => e.PostalCode) | ||
.HasDatabaseName("Employee_PostalCode"); | ||
|
||
builder.Property(e => e.EmployeeId).HasColumnName("EmployeeID") | ||
.ValueGeneratedNever(); | ||
|
||
builder.Property(e => e.Address).HasMaxLength(60); | ||
|
||
builder.Property(e => e.BirthDate).HasColumnType("datetime"); | ||
|
||
builder.Property(e => e.City).HasMaxLength(15); | ||
|
||
builder.Property(e => e.Country).HasMaxLength(15); | ||
|
||
builder.Property(e => e.Extension).HasMaxLength(4); | ||
|
||
builder.Property(e => e.FirstName) | ||
.IsRequired() | ||
.HasMaxLength(10); | ||
|
||
builder.Property(e => e.HireDate).HasColumnType("datetime"); | ||
|
||
builder.Property(e => e.HomePhone).HasMaxLength(24); | ||
|
||
builder.Property(e => e.LastName) | ||
.IsRequired() | ||
.HasMaxLength(20); | ||
|
||
builder.Property(e => e.Notes).HasColumnType("text"); | ||
|
||
builder.Property(e => e.Photo).HasColumnType("blob"); | ||
|
||
builder.Property(e => e.PhotoPath).HasMaxLength(255); | ||
|
||
builder.Property(e => e.PostalCode).HasMaxLength(10); | ||
|
||
builder.Property(e => e.Region).HasMaxLength(15); | ||
|
||
builder.Property(e => e.Title).HasMaxLength(30); | ||
|
||
builder.Property(e => e.TitleOfCourtesy).HasMaxLength(25); | ||
|
||
builder.HasOne(d => d.ReportsToNavigation) | ||
.WithMany(p => p!.InverseReportsToNavigation) | ||
.HasForeignKey(d => d.ReportsTo) | ||
.HasConstraintName("FK_Employees_Employees"); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
Tests/LinqToDB.EntityFrameworkCore.SQLite.Tests/Models/Northwind.Mapping/OrderDetailsMap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using LinqToDB.EntityFrameworkCore.BaseTests.Models.Northwind; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace LinqToDB.EntityFrameworkCore.SQLite.Tests.Models.Northwind.Mapping | ||
{ | ||
public class OrderDetailsMap : IEntityTypeConfiguration<OrderDetail> | ||
{ | ||
public void Configure(EntityTypeBuilder<OrderDetail> builder) | ||
{ | ||
builder.HasKey(e => new { e.OrderId, e.ProductId }); | ||
|
||
builder.ToTable("Order Details"); | ||
|
||
builder.HasIndex(e => e.OrderId) | ||
.HasDatabaseName("OrdersOrder_Details"); | ||
|
||
builder.HasIndex(e => e.ProductId) | ||
.HasDatabaseName("ProductsOrder_Details"); | ||
|
||
builder.Property(e => e.OrderId).HasColumnName("OrderID"); | ||
|
||
builder.Property(e => e.ProductId).HasColumnName("ProductID"); | ||
|
||
builder.Property(e => e.Quantity).HasDefaultValue(1); | ||
|
||
builder.Property(e => e.UnitPrice).HasColumnType("decimal(13, 4)"); | ||
|
||
builder.HasOne(d => d.Order) | ||
.WithMany(p => p.OrderDetails) | ||
.HasForeignKey(d => d.OrderId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_Order_Details_Orders"); | ||
|
||
builder.HasOne(d => d.Product) | ||
.WithMany(p => p.OrderDetails) | ||
.HasForeignKey(d => d.ProductId) | ||
.OnDelete(DeleteBehavior.ClientSetNull) | ||
.HasConstraintName("FK_Order_Details_Products"); | ||
} | ||
} | ||
} |
Oops, something went wrong.