Skip to content

Commit c008d05

Browse files
committed
Updated Entity Framework 5 to the latest version 6
1 parent fcbb4e4 commit c008d05

39 files changed

Lines changed: 283 additions & 169 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<entityFramework>
8+
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
9+
<providers>
10+
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
11+
</providers>
12+
</entityFramework>
13+
</configuration>

src/Libraries/SmartStore.Core/SmartStore.Core.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
<HintPath>..\..\packages\Autofac.Mvc5.3.0.0\lib\net45\Autofac.Integration.Mvc.dll</HintPath>
5050
</Reference>
5151
<Reference Include="EntityFramework">
52-
<HintPath>..\..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
52+
<HintPath>..\..\packages\EntityFramework.6.0.1\lib\net45\EntityFramework.dll</HintPath>
53+
</Reference>
54+
<Reference Include="EntityFramework.SqlServer">
55+
<HintPath>..\..\packages\EntityFramework.6.0.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
5356
</Reference>
5457
<Reference Include="Fasterflect">
5558
<HintPath>..\..\packages\fasterflect.2.1.0\lib\net40\Fasterflect.dll</HintPath>
@@ -64,6 +67,7 @@
6467
</Reference>
6568
<Reference Include="System" />
6669
<Reference Include="System.ComponentModel.Composition" />
70+
<Reference Include="System.ComponentModel.DataAnnotations" />
6771
<Reference Include="System.configuration" />
6872
<Reference Include="System.Core" />
6973
<Reference Include="System.Drawing" />
@@ -466,6 +470,7 @@
466470
<Compile Include="XmlHelper.cs" />
467471
</ItemGroup>
468472
<ItemGroup>
473+
<None Include="App.config" />
469474
<None Include="packages.config" />
470475
</ItemGroup>
471476
<ItemGroup />

src/Libraries/SmartStore.Core/SmartStoreVersion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public static class SmartStoreVersion
1717
// A release with breaking changes should definitely have at least
1818
// a greater minor version.
1919
new Version("1.2"),
20-
new Version("1.2.1") // MC: had to be :-(
20+
new Version("1.2.1"), // MC: had to be :-(
21+
new Version("1.3")
2122
};
2223

2324
static SmartStoreVersion()

src/Libraries/SmartStore.Core/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<packages>
33
<package id="Autofac" version="3.1.5" targetFramework="net45" />
44
<package id="Autofac.Mvc5" version="3.0.0" targetFramework="net45" />
5+
<package id="EntityFramework" version="6.0.1" targetFramework="net45" />
56
<package id="fasterflect" version="2.1.0" targetFramework="net45" />
67
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
78
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
7+
</configSections>
8+
<entityFramework>
9+
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
10+
<parameters>
11+
<parameter value="System.Data.SqlServerCe.4.0" />
12+
</parameters>
13+
</defaultConnectionFactory>
14+
<providers>
15+
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
16+
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
17+
</providers>
18+
</entityFramework>
19+
</configuration>

src/Libraries/SmartStore.Data/EfRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Data.Entity;
55
using System.Data.Entity.Infrastructure;
66
using System.Data.Entity.Validation;
7-
using System.Data.Objects;
7+
using System.Data.Entity.Core.Objects;
88
using System.Linq;
99
using System.Linq.Expressions;
1010
using SmartStore.Core;
@@ -119,7 +119,7 @@ public void Update(T entity)
119119
try
120120
{
121121
this.Entities.Attach(entity);
122-
InternalContext.Entry(entity).State = System.Data.EntityState.Modified;
122+
InternalContext.Entry(entity).State = System.Data.Entity.EntityState.Modified;
123123
}
124124
finally { }
125125
}
@@ -130,7 +130,7 @@ public void Delete(T entity)
130130
if (entity == null)
131131
throw new ArgumentNullException("entity");
132132

133-
if (InternalContext.Entry(entity).State == System.Data.EntityState.Detached)
133+
if (InternalContext.Entry(entity).State == System.Data.Entity.EntityState.Detached)
134134
{
135135
this.Entities.Attach(entity);
136136
}

src/Libraries/SmartStore.Data/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
using System.Data.Objects;
2+
using System.Data.Entity.Core.Objects;
33
using SmartStore.Core;
44

55
namespace SmartStore.Data

src/Libraries/SmartStore.Data/ObjectContextBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public bool HasChanges
306306
get
307307
{
308308
return this.ChangeTracker.Entries()
309-
.Where(x => x.State != System.Data.EntityState.Unchanged && x.State != System.Data.EntityState.Detached)
309+
.Where(x => x.State != System.Data.Entity.EntityState.Unchanged && x.State != System.Data.Entity.EntityState.Detached)
310310
.Any();
311311
}
312312
}
@@ -320,7 +320,7 @@ public override int SaveChanges()
320320
if (hooksEnabled)
321321
{
322322
modifiedEntries = this.ChangeTracker.Entries()
323-
.Where(x => x.State != System.Data.EntityState.Unchanged && x.State != System.Data.EntityState.Detached)
323+
.Where(x => x.State != System.Data.Entity.EntityState.Unchanged && x.State != System.Data.Entity.EntityState.Detached)
324324
.Select(x => new HookedEntityEntry()
325325
{
326326
Entity = x.Entity,

src/Libraries/SmartStore.Data/SmartStore.Data.csproj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@
4040
<Prefer32Bit>false</Prefer32Bit>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
43+
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
4444
<SpecificVersion>False</SpecificVersion>
45-
<HintPath>..\..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
45+
<HintPath>..\..\packages\EntityFramework.6.0.1\lib\net45\EntityFramework.dll</HintPath>
46+
</Reference>
47+
<Reference Include="EntityFramework.SqlServer">
48+
<HintPath>..\..\packages\EntityFramework.6.0.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
49+
</Reference>
50+
<Reference Include="EntityFramework.SqlServerCompact">
51+
<HintPath>..\..\packages\EntityFramework.SqlServerCompact.6.0.1\lib\net45\EntityFramework.SqlServerCompact.dll</HintPath>
4652
</Reference>
4753
<Reference Include="Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
4854
<Private>True</Private>
@@ -59,15 +65,10 @@
5965
<Reference Include="System" />
6066
<Reference Include="System.ComponentModel.DataAnnotations" />
6167
<Reference Include="System.Core" />
62-
<Reference Include="System.Data.Entity" />
6368
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
6469
<Private>True</Private>
6570
<HintPath>..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll</HintPath>
6671
</Reference>
67-
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
68-
<Private>True</Private>
69-
<HintPath>..\..\packages\EntityFramework.SqlServerCompact.4.3.5\lib\net40\System.Data.SqlServerCe.Entity.dll</HintPath>
70-
</Reference>
7172
<Reference Include="System.Transactions" />
7273
<Reference Include="System.Web" />
7374
<Reference Include="System.Xml.Linq" />
@@ -197,6 +198,7 @@
197198
<Compile Include="EfStartUpTask.cs" />
198199
</ItemGroup>
199200
<ItemGroup>
201+
<None Include="App.config" />
200202
<None Include="packages.config" />
201203
</ItemGroup>
202204
<ItemGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="EntityFramework" version="5.0.0" targetFramework="net45" />
4-
<package id="EntityFramework.SqlServerCompact" version="4.3.5" targetFramework="net45" />
3+
<package id="EntityFramework" version="6.0.1" targetFramework="net45" />
4+
<package id="EntityFramework.SqlServerCompact" version="6.0.1" targetFramework="net45" />
55
<package id="Microsoft.SqlServer.Compact" version="4.0.8876.1" targetFramework="net45" />
66
<package id="Microsoft.SqlServer.Scripting" version="11.0.2100.61" targetFramework="net45" />
77
</packages>

0 commit comments

Comments
 (0)