Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions System.Linq.Dynamic.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "System.Linq.Dynamic.Core",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAppPerformanceTest236", "src-console\ConsoleAppPerformanceTest236\ConsoleAppPerformanceTest236.csproj", "{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -406,6 +408,22 @@ Global
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x64.Build.0 = Release|Any CPU
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x86.ActiveCfg = Release|Any CPU
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84}.Release|x86.Build.0 = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|ARM.ActiveCfg = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|ARM.Build.0 = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|x64.ActiveCfg = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|x64.Build.0 = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|x86.ActiveCfg = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Debug|x86.Build.0 = Debug|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|Any CPU.Build.0 = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|ARM.ActiveCfg = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|ARM.Build.0 = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|x64.ActiveCfg = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|x64.Build.0 = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|x86.ActiveCfg = Release|Any CPU
{36B101B1-720B-4770-B222-C6ADD464F9EC}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -431,6 +449,7 @@ Global
{926D446C-8358-465A-AFAC-2F9078C22262} = {ECA5702B-5D32-4888-A34E-9461FC533F23}
{591F9224-A8D6-49CF-8AF8-F9B383C1F9FF} = {1384C18E-DCF3-4A5B-9560-2BF5DD8C51CE}
{E9C52E5E-28DC-4D45-B9AB-1B2CF2924A84} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
{36B101B1-720B-4770-B222-C6ADD464F9EC} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
using System.Data.Common;
using System.Data.Entity;
using System.Linq.Dynamic.Core.ConsoleTestApp.net452.Entities;

namespace ConsoleApp_net452_EF6.Entities
{
public partial class KendoGridDbContext : DbContext
public class KendoGridDbContext : DbContext
{
public KendoGridDbContext(DbConnection connection)
: base(connection, false)
{
}

public KendoGridDbContext()
: base("name=KendoGrid")
{
Expand Down
19 changes: 19 additions & 0 deletions src-console/ConsoleApp_net452_EF6_Effort/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>-->
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{36B101B1-720B-4770-B222-C6ADD464F9EC}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp_net452_EF6</RootNamespace>
<AssemblyName>ConsoleApp_net452_EF6</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Effort, Version=2.2.2.0, Culture=neutral, PublicKeyToken=6a46696d54971e6d, processorArchitecture=MSIL">
<HintPath>..\..\packages\Effort.EF6.2.2.2\lib\net45\Effort.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\FSharp.Core.4.2.3\lib\net45\FSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Linq.Expression.Optimizer, Version=1.0.6.0, Culture=neutral, PublicKeyToken=34b6af2337893e15, processorArchitecture=MSIL">
<HintPath>..\..\packages\Linq.Expression.Optimizer.1.0.9\lib\net45\Linq.Expression.Optimizer.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NMemory, Version=3.0.0.0, Culture=neutral, PublicKeyToken=afc61983f100d280, processorArchitecture=MSIL">
<HintPath>..\..\packages\NMemory.3.1.0\lib\net45\NMemory.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Company.cs">
<Link>Entities\Company.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Country.cs">
<Link>Entities\Country.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Employee.cs">
<Link>Entities\Employee.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Function.cs">
<Link>Entities\Function.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\KendoGridDbContext.cs">
<Link>Entities\KendoGridDbContext.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\MainCompany.cs">
<Link>Entities\MainCompany.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\OU.cs">
<Link>Entities\OU.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Product.cs">
<Link>Entities\Product.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\Role.cs">
<Link>Entities\Role.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\SubFunction.cs">
<Link>Entities\SubFunction.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\User.cs">
<Link>Entities\User.cs</Link>
</Compile>
<Compile Include="..\ConsoleApp_net452_EF6\Entities\VW_EmployeeDetails.cs">
<Link>Entities\VW_EmployeeDetails.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EntityFramework.DynamicLinq\EntityFramework.DynamicLinq.csproj">
<Project>{8b9ceafa-ed50-4682-8531-a082cfd3fdae}</Project>
<Name>EntityFramework.DynamicLinq</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\System.Linq.Dynamic.Core\System.Linq.Dynamic.Core.csproj">
<Project>{b70cd050-3b9c-406c-85fd-1a26394ec7c8}</Project>
<Name>System.Linq.Dynamic.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
56 changes: 56 additions & 0 deletions src-console/ConsoleApp_net452_EF6_Effort/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Linq;
using System.Linq.Dynamic.Core;
using ConsoleApp_net452_EF6.Entities;
using Effort;
using Newtonsoft.Json;

namespace ConsoleApp_net452_EF6
{
class Program
{
static void Main(string[] args)
{
var connection = DbConnectionFactory.CreateTransient();

using (var context = new KendoGridDbContext(connection))
{
context.KendoGridCountry.Add(new Country { Code = "NL", Name = "Nederland" });

var main1 = new MainCompany { Name = "Main1" };
context.KendoGridMainCompany.Add(main1);

var main2 = new MainCompany { Name = "Main2" };
context.KendoGridMainCompany.Add(main2);

var company = new Company { Name = "Other", MainCompany = main1 };
context.KendoGridCompany.Add(company);

context.SaveChanges();
}

using (var context = new KendoGridDbContext(connection))
{
foreach (var c in context.KendoGridCountry.AsNoTracking().Where(c => c.Code.StartsWith("N")))
{
Console.WriteLine(JsonConvert.SerializeObject(c, Formatting.Indented));
}

var main2Id = context.KendoGridMainCompany.First(mc => mc.Name == "Main2").Id;

var company = context.KendoGridCompany.First();
company.MainCompanyId = main2Id;

context.SaveChanges();
}

using (var context = new KendoGridDbContext(connection))
{
foreach (var c in context.KendoGridCompany.AsNoTracking())
{
Console.WriteLine(c.Name + " " + c.MainCompany.Name);
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleApp_net452_EF6_Effort")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp_net452_EF6_Effort")]
[assembly: AssemblyCopyright("Copyright © Stef Heyenrath 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5dc68e83-abaa-4887-b17e-1ed4eee89c2c")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
9 changes: 9 additions & 0 deletions src-console/ConsoleApp_net452_EF6_Effort/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Effort.EF6" version="2.2.2" targetFramework="net452" />
<package id="EntityFramework" version="6.2.0" targetFramework="net452" />
<package id="FSharp.Core" version="4.2.3" targetFramework="net452" />
<package id="Linq.Expression.Optimizer" version="1.0.9" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="NMemory" version="3.1.0" targetFramework="net452" />
</packages>