Skip to content

Commit fc2bdf4

Browse files
authored
Z.EntityFramework.Classic (#262)
* Z.EntityFramework.Classic * EFDYNAMICFUNCTIONS * . * 1.0.14 and readme and pipelines * latest Z version * ConsoleApp.EntityFrameworkClassic * .
1 parent e58e1e0 commit fc2bdf4

File tree

11 files changed

+190
-9
lines changed

11 files changed

+190
-9
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ There are several documentation resources:
3737
|   **System.Linq.Dynamic.Core** | [![NuGet](https://buildstats.info/nuget/System.Linq.Dynamic.Core)](https://www.nuget.org/packages/System.Linq.Dynamic.Core) |
3838
|   **EntityFramework.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/EntityFramework.DynamicLinq)](https://www.nuget.org/packages/EntityFramework.DynamicLinq) |
3939
|   **Microsoft.EntityFrameworkCore.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.DynamicLinq) |
40+
|   **Z.EntityFramework.Classic.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/Z.EntityFramework.Classic.DynamicLinq)](https://www.nuget.org/packages/Z.EntityFramework.Classic.DynamicLinq) |
4041
| ***MyGet (previews)*** |   |
4142
|   **System.Linq.Dynamic.Core** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/System.Linq.Dynamic.Core)](https://www.myget.org/feed/system-linq-dynamic-core/package/nuget/System.Linq.Dynamic.Core) |
4243
|   **EntityFramework.DynamicLinq** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/EntityFramework.DynamicLinq)](https://www.myget.org/feed/system-linq-dynamic-core/package/nuget/EntityFramework.DynamicLinq) |
4344
|   **Microsoft.EntityFrameworkCore.DynamicLinq** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.myget.org/feed/system-linq-dynamic-core/package/nuget/Microsoft.EntityFrameworkCore.DynamicLinq) |
45+
|   **Z.EntityFramework.Classic.DynamicLinq** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/Z.EntityFramework.Classic.DynamicLinq)](https://www.myget.org/feed/system-linq-dynamic-core/package/nuget/Z.EntityFramework.Classic.DynamicLinq) |
4446

4547
# Development Details
4648

System.Linq.Dynamic.Core.sln

+38
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAppPerformanceTest23
7878
EndProject
7979
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp_net452_EF6_Effort", "src-console\ConsoleApp_net452_EF6_Effort\ConsoleApp_net452_EF6_Effort.csproj", "{36B101B1-720B-4770-B222-C6ADD464F9EC}"
8080
EndProject
81+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Z.EntityFramework.Classic.DynamicLinq", "src\Z.EntityFramework.Classic.DynamicLinq\Z.EntityFramework.Classic.DynamicLinq.csproj", "{D3804228-91F4-4502-9595-39584EA20000}"
82+
EndProject
83+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp.EntityFrameworkClassic", "src-console\ConsoleApp.EntityFrameworkClassic\ConsoleApp.EntityFrameworkClassic.csproj", "{0077F262-D69B-44D2-8A7C-87D8D19022A6}"
84+
EndProject
8185
Global
8286
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8387
Debug|Any CPU = Debug|Any CPU
@@ -408,6 +412,38 @@ Global
408412
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x64.Build.0 = Release|Any CPU
409413
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x86.ActiveCfg = Release|Any CPU
410414
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x86.Build.0 = Release|Any CPU
415+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
416+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|Any CPU.Build.0 = Debug|Any CPU
417+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|ARM.ActiveCfg = Debug|Any CPU
418+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|ARM.Build.0 = Debug|Any CPU
419+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|x64.ActiveCfg = Debug|Any CPU
420+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|x64.Build.0 = Debug|Any CPU
421+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|x86.ActiveCfg = Debug|Any CPU
422+
{D3804228-91F4-4502-9595-39584EA20000}.Debug|x86.Build.0 = Debug|Any CPU
423+
{D3804228-91F4-4502-9595-39584EA20000}.Release|Any CPU.ActiveCfg = Release|Any CPU
424+
{D3804228-91F4-4502-9595-39584EA20000}.Release|Any CPU.Build.0 = Release|Any CPU
425+
{D3804228-91F4-4502-9595-39584EA20000}.Release|ARM.ActiveCfg = Release|Any CPU
426+
{D3804228-91F4-4502-9595-39584EA20000}.Release|ARM.Build.0 = Release|Any CPU
427+
{D3804228-91F4-4502-9595-39584EA20000}.Release|x64.ActiveCfg = Release|Any CPU
428+
{D3804228-91F4-4502-9595-39584EA20000}.Release|x64.Build.0 = Release|Any CPU
429+
{D3804228-91F4-4502-9595-39584EA20000}.Release|x86.ActiveCfg = Release|Any CPU
430+
{D3804228-91F4-4502-9595-39584EA20000}.Release|x86.Build.0 = Release|Any CPU
431+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
432+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
433+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|ARM.ActiveCfg = Debug|Any CPU
434+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|ARM.Build.0 = Debug|Any CPU
435+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|x64.ActiveCfg = Debug|Any CPU
436+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|x64.Build.0 = Debug|Any CPU
437+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|x86.ActiveCfg = Debug|Any CPU
438+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Debug|x86.Build.0 = Debug|Any CPU
439+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
440+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|Any CPU.Build.0 = Release|Any CPU
441+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|ARM.ActiveCfg = Release|Any CPU
442+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|ARM.Build.0 = Release|Any CPU
443+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|x64.ActiveCfg = Release|Any CPU
444+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|x64.Build.0 = Release|Any CPU
445+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|x86.ActiveCfg = Release|Any CPU
446+
{0077F262-D69B-44D2-8A7C-87D8D19022A6}.Release|x86.Build.0 = Release|Any CPU
411447
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
412448
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
413449
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -449,6 +485,8 @@ Global
449485
{926D446C-8358-465A-AFAC-2F9078C22262} = {ECA5702B-5D32-4888-A34E-9461FC533F23}
450486
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF} = {1384C18E-DCF3-4A5B-9560-2BF5DD8C51CE}
451487
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
488+
{D3804228-91F4-4502-9595-39584EA20000} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
489+
{0077F262-D69B-44D2-8A7C-87D8D19022A6} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
452490
{36B101B1-720B-4770-B222-C6ADD464F9EC} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
453491
EndGlobalSection
454492
GlobalSection(ExtensibilityGlobals) = postSolution

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variables:
55
Prerelease: 'ci'
66
buildType: 'azure-pipelines-ci'
77
buildId: "1$(Build.BuildId)"
8-
buildProjects: '**/src/**/+(System.Linq.Dynamic.Core|EntityFramework.DynamicLinq|Microsoft.EntityFrameworkCore.DynamicLinq).csproj'
8+
buildProjects: '**/src/**/+(System.Linq.Dynamic.Core|EntityFramework.DynamicLinq|Microsoft.EntityFrameworkCore.DynamicLinq|Z.EntityFramework.Classic.DynamicLinq).csproj'
99

1010
steps:
1111
# Print buildId
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Z.EntityFramework.Classic" Version="7.1.7" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\src\Z.EntityFramework.Classic.DynamicLinq\Z.EntityFramework.Classic.DynamicLinq.csproj" />
14+
</ItemGroup>
15+
16+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
using System;
2+
using System.Data.Entity;
3+
using System.Linq;
4+
using System.Linq.Dynamic.Core;
5+
6+
namespace ConsoleApp.EntityFrameworkClassic
7+
{
8+
internal class Program
9+
{
10+
public static string ConnectionString = "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EFClassic;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
11+
12+
public static void Main()
13+
{
14+
// CLEAR
15+
using (var context = new EntityContext())
16+
{
17+
context.Customers.RemoveRange(context.Customers);
18+
context.SaveChanges();
19+
20+
Console.WriteLine("Database clearer...");
21+
}
22+
23+
// ADD 2 new customers
24+
using (var context = new EntityContext())
25+
{
26+
context.Customers.Add(new Customer { Name = "Customer_A", Description = "Description", IsActive = true });
27+
context.Customers.Add(new Customer { Name = "Customer_B", Description = "Description", IsActive = true });
28+
29+
context.SaveChanges();
30+
31+
Console.WriteLine("Customers added...");
32+
}
33+
34+
using (var context = new EntityContext())
35+
{
36+
foreach (var customer in context.Customers.AsQueryable().Where("it != null && CustomerID >= 1000").ToList())
37+
{
38+
Console.WriteLine("");
39+
Console.WriteLine("Customer.CustomerID : " + customer.CustomerID);
40+
Console.WriteLine("Customer.Name : " + customer.Name);
41+
Console.WriteLine("Customer.Description : " + customer.Description);
42+
Console.WriteLine("Customer.IsActive : " + customer.IsActive);
43+
}
44+
45+
Console.WriteLine("");
46+
Console.WriteLine("---");
47+
Console.WriteLine("");
48+
}
49+
50+
Console.WriteLine("Press any key.");
51+
Console.ReadKey();
52+
}
53+
54+
public class EntityContext : DbContext
55+
{
56+
public EntityContext() : base(ConnectionString)
57+
{
58+
}
59+
60+
public DbSet<Customer> Customers { get; set; }
61+
}
62+
63+
public class Customer
64+
{
65+
public int CustomerID { get; set; }
66+
public string Name { get; set; }
67+
public string Description { get; set; }
68+
public bool IsActive { get; set; }
69+
}
70+
}
71+
}

src/EntityFramework.DynamicLinq/EntityFramework.DynamicLinq.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AssemblyTitle>EntityFramework.DynamicLinq</AssemblyTitle>
55
<Authors>Stef Heyenrath</Authors>
66
<TargetFrameworks>net45;net46</TargetFrameworks>
7-
<DefineConstants>EF</DefineConstants>
7+
<DefineConstants>EF;EFDYNAMICFUNCTIONS</DefineConstants>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<AssemblyName>EntityFramework.DynamicLinq</AssemblyName>
1010
<AssemblyOriginatorKeyFile>EntityFramework.DynamicLinq.snk</AssemblyOriginatorKeyFile>

src/Microsoft.EntityFrameworkCore.DynamicLinq/DynamicFunctions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.EntityFrameworkCore.DynamicLinq
88
[DynamicLinqType]
99
public static class DynamicFunctions
1010
{
11-
#if NETSTANDARD2_0
11+
#if (NETSTANDARD2_0 || NETCOREAPP2_1) && EFDYNAMICFUNCTIONS
1212
/// <summary>
1313
/// <para>
1414
/// An implementation of the SQL LIKE operation. On relational databases this is usually directly

src/Microsoft.EntityFrameworkCore.DynamicLinq/Microsoft.EntityFrameworkCore.DynamicLinq.csproj

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AssemblyTitle>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyTitle>
55
<Authors>Stef Heyenrath</Authors>
66
<TargetFrameworks>net451;net46;netstandard1.3;netstandard2.0;uap10.0;netcoreapp2.1</TargetFrameworks>
7-
<DefineConstants>$(DefineConstants);EFCORE</DefineConstants>
7+
<DefineConstants>$(DefineConstants);EFCORE;EFDYNAMICFUNCTIONS</DefineConstants>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<AssemblyName>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyName>
1010
<AssemblyOriginatorKeyFile>Microsoft.EntityFrameworkCore.DynamicLinq.snk</AssemblyOriginatorKeyFile>
@@ -96,11 +96,7 @@
9696
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.0" />
9797
</ItemGroup>
9898

99-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
100-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" />
101-
</ItemGroup>
102-
103-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
99+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
104100
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" />
105101
</ItemGroup>
106102

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Runtime.InteropServices;
2+
3+
// Setting ComVisible to false makes the types in this assembly not visible
4+
// to COM components. If you need to access a type in this assembly from
5+
// COM, set the ComVisible attribute to true on that type.
6+
[assembly: ComVisible(false)]
7+
8+
// The following GUID is for the ID of the typelib if this project is exposed to COM
9+
[assembly: Guid("D3804228-91F4-4502-9595-39584Ea20000")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
2+
<PropertyGroup>
3+
<Description>Dynamic Linq extensions for Z.EntityFramework.Classic which adds Async support</Description>
4+
<AssemblyTitle>Z.EntityFramework.Classic.DynamicLinq</AssemblyTitle>
5+
<Authors>Stef Heyenrath</Authors>
6+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
7+
<DefineConstants>EF</DefineConstants>
8+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9+
<AssemblyName>Z.EntityFramework.Classic.DynamicLinq</AssemblyName>
10+
<AssemblyOriginatorKeyFile>Z.EntityFramework.Classic.DynamicLinq.snk</AssemblyOriginatorKeyFile>
11+
<SignAssembly>true</SignAssembly>
12+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
13+
<PackageTags>system;linq;dynamic;Z.EntityFramework;core;async;classic</PackageTags>
14+
<PackageReleaseNotes>Bugfixes and new Features. For details see CHANGELOG.md</PackageReleaseNotes>
15+
<PackageProjectUrl>https://github.com/StefH/System.Linq.Dynamic.Core</PackageProjectUrl>
16+
<PackageLicenseUrl>https://raw.githubusercontent.com/StefH/System.Linq.Dynamic.Core/master/LICENSE</PackageLicenseUrl>
17+
<RepositoryType>git</RepositoryType>
18+
<RepositoryUrl>https://github.com/StefH/System.Linq.Dynamic.Core</RepositoryUrl>
19+
<DefaultLanguage>en-us</DefaultLanguage>
20+
<ProjectGuid>{D3804228-91F4-4502-9595-39584Ea20000}</ProjectGuid>
21+
<DebugType>full</DebugType>
22+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
23+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
24+
</PropertyGroup>
25+
26+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
27+
<!--<IncludeSource>True</IncludeSource>
28+
<IncludeSymbols>True</IncludeSymbols>
29+
<PathMap>$(MSBuildProjectDirectory)=/</PathMap>-->
30+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<Compile Include="..\System.Linq.Dynamic.Core\Res.cs" />
35+
<Compile Include="..\System.Linq.Dynamic.Core\Compatibility\*.cs" />
36+
<Compile Include="..\System.Linq.Dynamic.Core\Extensions\*.cs" />
37+
<Compile Include="..\System.Linq.Dynamic.Core\Validation\*.cs" />
38+
<Compile Include="..\Microsoft.EntityFrameworkCore.DynamicLinq\*.cs" />
39+
</ItemGroup>
40+
41+
<ItemGroup>
42+
<ProjectReference Include="..\System.Linq.Dynamic.Core\System.Linq.Dynamic.Core.csproj" />
43+
</ItemGroup>
44+
45+
<ItemGroup>
46+
<PackageReference Include="JetBrains.Annotations" Version="10.2.1" PrivateAssets="All" />
47+
<PackageReference Include="Z.EntityFramework.Classic" Version="7.1.7" />
48+
</ItemGroup>
49+
</Project>
Binary file not shown.

0 commit comments

Comments
 (0)