Skip to content

Commit 1a7daf6

Browse files
committed
fix #32
1 parent 70b30ae commit 1a7daf6

File tree

15 files changed

+317
-59
lines changed

15 files changed

+317
-59
lines changed

System.Linq.Dynamic.Core.sln

+43-20
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalWindowsApp", "test
3535
EndProject
3636
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{2EF50FA7-4E0A-4029-8864-765C3C76F9CA}"
3737
EndProject
38-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "System.Linq.Dynamic.Core.SandCastle", "doc\System.Linq.Dynamic.Core.SandCastle\System.Linq.Dynamic.Core.SandCastle.xproj", "{42D44936-AC53-4207-8161-8A06B5B29F75}"
39-
EndProject
4038
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Linq.Dynamic.Core.ConsoleTestApp.net452", "src-console\System.Linq.Dynamic.Core.ConsoleTestApp.net452\System.Linq.Dynamic.Core.ConsoleTestApp.net452.csproj", "{467B5A08-2A38-45B6-BC29-4C013B280448}"
4139
ProjectSection(ProjectDependencies) = postProject
4240
{CE1620BD-A313-4223-B991-467DA346B2ED} = {CE1620BD-A313-4223-B991-467DA346B2ED}
@@ -54,7 +52,15 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework.DynamicLinq
5452
EndProject
5553
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework.DynamicLinq.Tests", "test\EntityFramework.DynamicLinq.Tests\EntityFramework.DynamicLinq.Tests.xproj", "{3577BAD5-CD9B-4B8F-B326-DF11836E9E1F}"
5654
EndProject
57-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupByError.net452", "src-console\GroupByError.net452\GroupByError.net452.csproj", "{8289B567-A687-4503-A4C3-4A5D4D1DF5A6}"
55+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupByError.Microsoft.EntityFrameworkCore.net452", "src-console\GroupByError.net452\GroupByError.Microsoft.EntityFrameworkCore.net452.csproj", "{8289B567-A687-4503-A4C3-4A5D4D1DF5A6}"
56+
EndProject
57+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupByError.EntityFramework.net452", "src-console\GroupByError.EntityFramework.net452\GroupByError.EntityFramework.net452.csproj", "{8289B567-A687-4503-A4C3-4A5D4D1DF999}"
58+
ProjectSection(ProjectDependencies) = postProject
59+
{54415664-A73E-47AF-B21F-E66B2DB2EF14} = {54415664-A73E-47AF-B21F-E66B2DB2EF14}
60+
{CE1620BD-A313-4223-B991-467DA346B2ED} = {CE1620BD-A313-4223-B991-467DA346B2ED}
61+
EndProjectSection
62+
EndProject
63+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "System.Linq.Dynamic.Core.SandCastle", "doc\System.Linq.Dynamic.Core.SandCastle\System.Linq.Dynamic.Core.SandCastle.xproj", "{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}"
5864
EndProject
5965
Global
6066
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -136,22 +142,6 @@ Global
136142
{A7D5D859-8216-427B-83DF-8604623F4775}.Release|x86.ActiveCfg = Release|x86
137143
{A7D5D859-8216-427B-83DF-8604623F4775}.Release|x86.Build.0 = Release|x86
138144
{A7D5D859-8216-427B-83DF-8604623F4775}.Release|x86.Deploy.0 = Release|x86
139-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
140-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|Any CPU.Build.0 = Debug|Any CPU
141-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|ARM.ActiveCfg = Debug|Any CPU
142-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|ARM.Build.0 = Debug|Any CPU
143-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|x64.ActiveCfg = Debug|Any CPU
144-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|x64.Build.0 = Debug|Any CPU
145-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|x86.ActiveCfg = Debug|Any CPU
146-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Debug|x86.Build.0 = Debug|Any CPU
147-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|Any CPU.ActiveCfg = Release|Any CPU
148-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|Any CPU.Build.0 = Release|Any CPU
149-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|ARM.ActiveCfg = Release|Any CPU
150-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|ARM.Build.0 = Release|Any CPU
151-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|x64.ActiveCfg = Release|Any CPU
152-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|x64.Build.0 = Release|Any CPU
153-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|x86.ActiveCfg = Release|Any CPU
154-
{42D44936-AC53-4207-8161-8A06B5B29F75}.Release|x86.Build.0 = Release|Any CPU
155145
{467B5A08-2A38-45B6-BC29-4C013B280448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
156146
{467B5A08-2A38-45B6-BC29-4C013B280448}.Debug|Any CPU.Build.0 = Debug|Any CPU
157147
{467B5A08-2A38-45B6-BC29-4C013B280448}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -280,6 +270,38 @@ Global
280270
{8289B567-A687-4503-A4C3-4A5D4D1DF5A6}.Release|x64.Build.0 = Release|Any CPU
281271
{8289B567-A687-4503-A4C3-4A5D4D1DF5A6}.Release|x86.ActiveCfg = Release|Any CPU
282272
{8289B567-A687-4503-A4C3-4A5D4D1DF5A6}.Release|x86.Build.0 = Release|Any CPU
273+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
274+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|Any CPU.Build.0 = Debug|Any CPU
275+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|ARM.ActiveCfg = Debug|Any CPU
276+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|ARM.Build.0 = Debug|Any CPU
277+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|x64.ActiveCfg = Debug|Any CPU
278+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|x64.Build.0 = Debug|Any CPU
279+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|x86.ActiveCfg = Debug|Any CPU
280+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Debug|x86.Build.0 = Debug|Any CPU
281+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|Any CPU.ActiveCfg = Release|Any CPU
282+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|Any CPU.Build.0 = Release|Any CPU
283+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|ARM.ActiveCfg = Release|Any CPU
284+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|ARM.Build.0 = Release|Any CPU
285+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|x64.ActiveCfg = Release|Any CPU
286+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|x64.Build.0 = Release|Any CPU
287+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|x86.ActiveCfg = Release|Any CPU
288+
{8289B567-A687-4503-A4C3-4A5D4D1DF999}.Release|x86.Build.0 = Release|Any CPU
289+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
290+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|Any CPU.Build.0 = Debug|Any CPU
291+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|ARM.ActiveCfg = Debug|Any CPU
292+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|ARM.Build.0 = Debug|Any CPU
293+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|x64.ActiveCfg = Debug|Any CPU
294+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|x64.Build.0 = Debug|Any CPU
295+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|x86.ActiveCfg = Debug|Any CPU
296+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Debug|x86.Build.0 = Debug|Any CPU
297+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|Any CPU.ActiveCfg = Release|Any CPU
298+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|Any CPU.Build.0 = Release|Any CPU
299+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|ARM.ActiveCfg = Release|Any CPU
300+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|ARM.Build.0 = Release|Any CPU
301+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|x64.ActiveCfg = Release|Any CPU
302+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|x64.Build.0 = Release|Any CPU
303+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|x86.ActiveCfg = Release|Any CPU
304+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C}.Release|x86.Build.0 = Release|Any CPU
283305
EndGlobalSection
284306
GlobalSection(SolutionProperties) = preSolution
285307
HideSolutionNode = FALSE
@@ -289,7 +311,6 @@ Global
289311
{0EB12661-F5CF-4071-9812-F4C8AF3D4531} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
290312
{F3415BB6-D7CA-4CCC-92EA-F48EDC20176E} = {DB9A5C42-3F8B-4546-96F2-DD35BCACA018}
291313
{A7D5D859-8216-427B-83DF-8604623F4775} = {E43ECBC5-D65A-4EE3-AF5D-5F74E9A4009A}
292-
{42D44936-AC53-4207-8161-8A06B5B29F75} = {2EF50FA7-4E0A-4029-8864-765C3C76F9CA}
293314
{467B5A08-2A38-45B6-BC29-4C013B280448} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
294315
{1BBA5141-F273-49A2-8F9E-11C70931D770} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
295316
{E0627580-2B20-4AD8-8D4F-20C96DBC0FC0} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
@@ -298,5 +319,7 @@ Global
298319
{54415664-A73E-47AF-B21F-E66B2DB2EF14} = {DB9A5C42-3F8B-4546-96F2-DD35BCACA018}
299320
{3577BAD5-CD9B-4B8F-B326-DF11836E9E1F} = {32699374-E6B9-4870-9D4A-C8884D16CEA9}
300321
{8289B567-A687-4503-A4C3-4A5D4D1DF5A6} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
322+
{8289B567-A687-4503-A4C3-4A5D4D1DF999} = {C98BB543-9BDA-4EE3-927D-0F10CC24A49B}
323+
{E9AD2D32-E69F-4F81-A6F4-AF0C27F0410C} = {2EF50FA7-4E0A-4029-8864-765C3C76F9CA}
301324
EndGlobalSection
302325
EndGlobal

doc/System.Linq.Dynamic.Core.SandCastle/System.Linq.Dynamic.Core.SandCastle.xproj

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
55
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
66
</PropertyGroup>
7-
87
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
98
<PropertyGroup Label="Globals">
10-
<ProjectGuid>42d44936-ac53-4207-8161-8a06b5b29f75</ProjectGuid>
9+
<ProjectGuid>e9ad2d32-e69f-4f81-a6f4-af0c27f0410c</ProjectGuid>
1110
<RootNamespace>System.Linq.Dynamic.Core.SandCastle</RootNamespace>
1211
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
1312
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1413
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1514
</PropertyGroup>
16-
1715
<PropertyGroup>
1816
<SchemaVersion>2.0</SchemaVersion>
1917
</PropertyGroup>
@@ -24,4 +22,4 @@
2422
<DnxInvisibleContent Include=".npmrc" />
2523
</ItemGroup>
2624
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
27-
</Project>
25+
</Project>

doc/System.Linq.Dynamic.Core.SandCastle/project.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
},
1111

1212
"tools": {
13-
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
14-
"version": "1.0.0",
15-
"imports": "portable-net45+win8+dnxcore50"
16-
}
13+
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
1714
},
1815

1916
"frameworks": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<configSections>
4+
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5+
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6+
</configSections>
7+
<startup>
8+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
9+
</startup>
10+
<entityFramework>
11+
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
12+
<parameters>
13+
<parameter value="mssqllocaldb" />
14+
</parameters>
15+
</defaultConnectionFactory>
16+
<providers>
17+
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
18+
</providers>
19+
</entityFramework>
20+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System.ComponentModel.DataAnnotations;
2+
using System.ComponentModel.DataAnnotations.Schema;
3+
using System.Data.Entity;
4+
5+
namespace GroupByError
6+
{
7+
[DbConfigurationType(typeof(CodeConfig))]
8+
public class MyDbContext : DbContext
9+
{
10+
public DbSet<Element> Elements { get; set; }
11+
12+
public MyDbContext(string nameOrConnectionString) : base(nameOrConnectionString)
13+
{
14+
}
15+
16+
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
17+
//{
18+
// optionsBuilder.UseSqlServer("Data Source=(LocalDB)\\MSSQLLocalDB;Initial Catalog=TestEFCore;Integrated Security=True;MultipleActiveResultSets=True");
19+
//}
20+
}
21+
22+
public class CodeConfig : DbConfiguration
23+
{
24+
public CodeConfig()
25+
{
26+
SetProviderServices("System.Data.SqlClient", System.Data.Entity.SqlServer.SqlProviderServices.Instance);
27+
}
28+
}
29+
30+
[Table("Element")]
31+
public class Element
32+
{
33+
[Key]
34+
public int Id { get; set; }
35+
public int Attribute1 { get; set; }
36+
public int Attribute2 { get; set; }
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{8289B567-A687-4503-A4C3-4A5D4D1DF999}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>GroupByError</RootNamespace>
11+
<AssemblyName>GroupByError</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
37+
<HintPath>..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
38+
<Private>True</Private>
39+
</Reference>
40+
<Reference Include="EntityFramework.DynamicLinq, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41+
<SpecificVersion>False</SpecificVersion>
42+
<HintPath>..\..\src\EntityFramework.DynamicLinq\bin\$(Configuration)\net452\EntityFramework.DynamicLinq.dll</HintPath>
43+
</Reference>
44+
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
45+
<HintPath>..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
46+
<Private>True</Private>
47+
</Reference>
48+
<Reference Include="System" />
49+
<Reference Include="System.ComponentModel.Composition" />
50+
<Reference Include="System.ComponentModel.DataAnnotations" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Linq.Dynamic.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
53+
<SpecificVersion>False</SpecificVersion>
54+
<HintPath>..\..\src\EntityFramework.DynamicLinq\bin\$(Configuration)\net452\System.Linq.Dynamic.Core.dll</HintPath>
55+
</Reference>
56+
<Reference Include="System.Transactions" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Net.Http" />
62+
<Reference Include="System.Xml" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="DbContext.cs" />
66+
<Compile Include="Program.cs" />
67+
<Compile Include="Properties\AssemblyInfo.cs" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<None Include="App.config" />
71+
<None Include="packages.config" />
72+
</ItemGroup>
73+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
74+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
75+
Other similar extension points exist, see Microsoft.Common.targets.
76+
<Target Name="BeforeBuild">
77+
</Target>
78+
<Target Name="AfterBuild">
79+
</Target>
80+
-->
81+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using System.Linq.Dynamic.Core;
4+
5+
namespace GroupByError
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
using (var db = new MyDbContext("Data Source=(LocalDB)\\MSSQLLocalDB;Initial Catalog=TestEF;Integrated Security=True;MultipleActiveResultSets=True"))
12+
{
13+
//In memory list.
14+
var ElementsList = AddElementsToList();
15+
16+
//Database
17+
db.Database.Delete();
18+
if (db.Database.CreateIfNotExists())
19+
{
20+
ElementsList.ForEach(e => db.Elements.Add(e));
21+
db.SaveChanges();
22+
}
23+
24+
//In memory tests.
25+
var resultList1 = ElementsList.GroupBy(el => new { el.Attribute1, el.Attribute2 }).ToArray(); //CORRECT
26+
var resultList2 = ElementsList.AsQueryable().GroupBy("new(Attribute1, Attribute2)").ToDynamicArray(); //CORRECT
27+
28+
//Database tests 1.
29+
var resultDb1a = db.Elements.GroupBy(el => new { el.Attribute1 }).ToArray(); //CORRECT
30+
var resultDb2a = db.Elements.GroupBy("Attribute1").ToDynamicArray(); //CORRECT
31+
32+
//Database tests 2.
33+
var resultDb1b = db.Elements.GroupBy(el => new { el.Attribute1, el.Attribute2 }).ToArray(); //CORRECT
34+
var resultDb2b = db.Elements.GroupBy("new(Attribute1, Attribute2)").ToDynamicArray(); //WRONG
35+
36+
int x = 0;
37+
}
38+
}
39+
40+
private static List<Element> AddElementsToList()
41+
{
42+
var elementList = new List<Element>();
43+
44+
for (int i = 0; i < 100; i++)
45+
{
46+
var element = new Element();
47+
48+
if (i < 25)
49+
{
50+
element.Attribute1 = 10;
51+
element.Attribute2 = 10;
52+
}
53+
else if (i < 50)
54+
{
55+
element.Attribute1 = 20;
56+
element.Attribute2 = 20;
57+
}
58+
else if (i < 75)
59+
{
60+
element.Attribute1 = 30;
61+
element.Attribute2 = 30;
62+
}
63+
else
64+
{
65+
element.Attribute1 = 40;
66+
element.Attribute2 = 40;
67+
}
68+
69+
elementList.Add(element);
70+
}
71+
72+
return elementList;
73+
}
74+
}
75+
}
76+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// La información general de un ensamblado se controla mediante el siguiente
6+
// conjunto de atributos. Cambie estos valores de atributo para modificar la información
7+
// asociada con un ensamblado.
8+
[assembly: AssemblyTitle("GroupByError")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("GroupByError")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
18+
// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde
19+
// COM, establezca el atributo ComVisible en true en este tipo.
20+
[assembly: ComVisible(false)]
21+
22+
// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
23+
[assembly: Guid("8289b567-a687-4503-a4c3-4a5d4d1df5a6")]
24+
25+
// La información de versión de un ensamblado consta de los cuatro valores siguientes:
26+
//
27+
// Versión principal
28+
// Versión secundaria
29+
// Número de compilación
30+
// Revisión
31+
//
32+
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
33+
// mediante el carácter '*', como se muestra a continuación:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)