Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
839ea09
upgrade to EF6
pwelter34 Oct 22, 2013
0793a0a
- update to EF6
pwelter34 Oct 22, 2013
4f070e8
update entities
pwelter34 Oct 22, 2013
62b2b04
update package
pwelter34 Oct 22, 2013
3b62f90
- convert to nunit
pwelter34 Oct 22, 2013
f4aadf9
Adding async support
taschmidt Nov 12, 2013
7a989ce
Change FromCache to return an IList instead of IEnumerable
taschmidt Nov 13, 2013
543bb51
- add DataContract attributes
Jan 24, 2014
f2e635b
fix build
Jan 24, 2014
2281b3a
Projects are upgraded to EF 6.1 and compatibility issues are fixed.
Mar 18, 2014
f86f7eb
code formatting: spaces are restored
Mar 18, 2014
2aa5c3c
Merge pull request #75 from taschmidt/master
pwelter34 Mar 20, 2014
387477e
Merge pull request #88 from StasPerekrestov/master
pwelter34 Mar 20, 2014
1f830c6
EF 6.1 support
Mar 23, 2014
2a999b9
fix build
Mar 23, 2014
6129ef8
add new Metadata mapping
Apr 21, 2014
8ae1c79
try to fix test
Apr 21, 2014
e06943f
Handle inheritance when determining mapping
ocdi Apr 23, 2014
2219133
Merge pull request #96 from ocdi/master
pwelter34 Apr 23, 2014
283caae
Fixed audit not always setting correct display value for optional rel…
wimr Aug 13, 2014
46853ee
Merge pull request #120 from wimr/master
pwelter34 Aug 13, 2014
bc206f3
Merge pull request #1 from loresoft/master
wimr Aug 25, 2014
a5f4df4
fix for issue #123: Auditlogger gives nullreference exception when tr…
wimr Aug 25, 2014
42a5266
Merge pull request #124 from wimr/master
pwelter34 Aug 27, 2014
5eaa3ad
refactor for new build
pwelter34 Aug 28, 2014
3744c09
tweak build
pwelter34 Aug 28, 2014
e3a0f79
tweak build
pwelter34 Sep 2, 2014
d7a6989
more build work
pwelter34 Sep 2, 2014
739ab37
fix xunit runner
pwelter34 Sep 2, 2014
8e2fccf
restore database on build
pwelter34 Sep 2, 2014
fc8d2f2
add all tests to build
pwelter34 Sep 2, 2014
d675db9
fix sql ddl restore
pwelter34 Sep 2, 2014
6eab682
build changes
pwelter34 Sep 3, 2014
58b7452
update build script to use sql 2014
Sep 3, 2014
a3e8a55
change when sql database is restored
Sep 3, 2014
0d2a5f3
- cleanup project
Sep 3, 2014
52f7eed
tweak unit testing
Sep 3, 2014
54161b0
more build tweaks
Sep 4, 2014
6d5966a
use SqlPackage to restore database
Sep 4, 2014
e2814c2
update connection string
Sep 4, 2014
428401a
fix tests
Sep 4, 2014
d2f2487
fix async issue
pwelter34 Sep 12, 2014
bb24f01
add IncludeInserts and IncludeDeletes to logging Configuration
pwelter34 Jan 5, 2015
244e468
fix failing test
pwelter34 Jan 5, 2015
0f4eab3
more test fixes
pwelter34 Jan 5, 2015
26f23b8
test fix
pwelter34 Jan 5, 2015
ef14ba4
disable test
pwelter34 Jan 6, 2015
29d5807
Clear Cache
PatelVish Jan 30, 2015
c7577ef
fix future queries running under transaction
DzheiZee Mar 18, 2015
0c7ff8a
Fix Bug "Sequence Contains More Than One Element"
acymiranda Mar 18, 2015
d6a563a
Revert "Fix Bug "Sequence Contains More Than One Element""
acymiranda Mar 18, 2015
950b0c3
Fix bug “Sequence contains more than one element” #101
acymiranda Mar 18, 2015
569128a
Merge pull request #156 from acymiranda/master
pwelter34 Mar 19, 2015
81ff0b2
Merge pull request #155 from DzheiZee/master
pwelter34 Mar 19, 2015
af32558
Merge pull request #146 from PatelVish/master
pwelter34 Mar 19, 2015
9772c75
updated nuget badge icons
pwelter34 Mar 22, 2015
3fd30ac
Fix bug "Delete with multiple EDMX"
acymiranda Mar 27, 2015
9cae97a
Merge pull request #157 from acymiranda/master
pwelter34 Mar 27, 2015
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
Prev Previous commit
Next Next commit
EF 6.1 support
  • Loading branch information
paul.welter committed Mar 23, 2014
commit 1f830c609a3e6971fb88f431b30f1e844437f4d3
4 changes: 2 additions & 2 deletions EntityFramework.Extended.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>EntityFramework.Extended</id>
<version>6.0.0.0</version>
<version>6.1.0.0</version>
<authors>LoreSoft</authors>
<owners>LoreSoft</owners>
<licenseUrl>https://github.com/loresoft/EntityFramework.Extended</licenseUrl>
<projectUrl>https://github.com/loresoft/EntityFramework.Extended</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A library that extends the functionality of Entity Framework by adding batch update, future queries and audit logs.</description>
<summary>Entity Framework extensions library.</summary>
<copyright>Copyright (c) 2013, LoreSoft</copyright>
<copyright>Copyright (c) 2014, LoreSoft</copyright>
<language>en-US</language>
<tags>EntityFramework</tags>
<dependencies>
Expand Down
9 changes: 3 additions & 6 deletions Master.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@

<PropertyGroup>
<Major>6</Major>
<Major4>5</Major4>

<Minor>0</Minor>
<Minor4>4</Minor4>
<Minor>1</Minor>

<Build>0</Build>
<BindBuild>0</BindBuild>
Expand All @@ -31,7 +28,7 @@
</PropertyGroup>

<PropertyGroup>
<Year>2013</Year>
<Year>2014</Year>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -79,7 +76,7 @@
AssemblyDescription="Entity Framework extensions library. Built for .NET 4.0"
AssemblyCompany="LoreSoft"
AssemblyCopyright="Copyright © $(Year) LoreSoft"
AssemblyVersion="$(Major4).$(Minor4).$(BindBuild).$(BindRevision)"
AssemblyVersion="$(Major).$(Minor).$(BindBuild).$(BindRevision)"
AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyInformationalVersion="$(Major).$(Minor).$(Build).$(Revision)"
GenerateClass="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@
<AssemblyOriginatorKeyFile>..\EntityFramework.Extended.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.dll</HintPath>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.0\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.0\lib\net40\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions">
<HintPath>..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FluentAssertions.2.2.0.0\lib\net40\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion Source/EntityFramework.Extended.Test/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.0" targetFramework="net45" />
<package id="FluentAssertions" version="2.1.0.0" targetFramework="net45" />
<package id="FluentAssertions" version="2.2.0.0" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
</packages>
9 changes: 6 additions & 3 deletions Source/EntityFramework.Extended/Batch/IBatchRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public interface IBatchRunner
/// <param name="entityMap">The <see cref="EntityMap"/> for <typeparamref name="TEntity"/>.</param>
/// <param name="query">The query to create the where clause from.</param>
/// <returns>The number of rows deleted.</returns>
int Delete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query)
int Delete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query)
where TEntity : class;

#if net45
/// <summary>
/// Create and runs a batch delete statement asynchronously.
/// </summary>
Expand All @@ -33,7 +34,7 @@ int Delete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuer
/// <returns>The number of rows deleted.</returns>
Task<int> DeleteAsync<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query)
where TEntity : class;

#endif
/// <summary>
/// Create and runs a batch update statement.
/// </summary>
Expand All @@ -43,9 +44,10 @@ Task<int> DeleteAsync<TEntity>(ObjectContext objectContext, EntityMap entityMap,
/// <param name="query">The query to create the where clause from.</param>
/// <param name="updateExpression">The update expression.</param>
/// <returns>The number of rows updated.</returns>
int Update<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression)
int Update<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression)
where TEntity : class;

#if net45
/// <summary>
/// Create and runs a batch update statement asynchronously.
/// </summary>
Expand All @@ -57,5 +59,6 @@ int Update<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuer
/// <returns>The number of rows updated.</returns>
Task<int> UpdateAsync<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression)
where TEntity : class;
#endif
}
}
35 changes: 31 additions & 4 deletions Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ public class SqlServerBatchRunner : IBatchRunner
/// </returns>
public int Delete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query) where TEntity : class
{
#if net45
return InternalDelete(objectContext, entityMap, query, false).Result;
#else
return InternalDelete(objectContext, entityMap, query);
#endif
}

#if net45
/// <summary>
/// Create and run a batch delete statement asynchronously.
/// </summary>
Expand All @@ -49,9 +54,15 @@ public Task<int> DeleteAsync<TEntity>(ObjectContext objectContext, EntityMap ent
{
return InternalDelete(objectContext, entityMap, query, true);
}
#endif

#if net45
private async Task<int> InternalDelete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, bool async = false)
where TEntity : class
#else
private int InternalDelete<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query)
where TEntity : class
#endif
{
DbConnection deleteConnection = null;
DbTransaction deleteTransaction = null;
Expand Down Expand Up @@ -110,10 +121,13 @@ private async Task<int> InternalDelete<TEntity>(ObjectContext objectContext, Ent

deleteCommand.CommandText = sqlBuilder.ToString();

#if net45
int result = async
? await deleteCommand.ExecuteNonQueryAsync()
: deleteCommand.ExecuteNonQuery();

#else
int result = deleteCommand.ExecuteNonQuery();
#endif
// only commit if created transaction
if (ownTransaction)
deleteTransaction.Commit();
Expand Down Expand Up @@ -146,9 +160,14 @@ private async Task<int> InternalDelete<TEntity>(ObjectContext objectContext, Ent
/// </returns>
public int Update<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression) where TEntity : class
{
#if net45
return InternalUpdate(objectContext, entityMap, query, updateExpression, false).Result;
#else
return InternalUpdate(objectContext, entityMap, query, updateExpression);
#endif
}

#if net45
/// <summary>
/// Create and run a batch update statement asynchronously.
/// </summary>
Expand All @@ -164,9 +183,14 @@ public Task<int> UpdateAsync<TEntity>(ObjectContext objectContext, EntityMap ent
{
return InternalUpdate(objectContext, entityMap, query, updateExpression, true);
}

#endif
#if net45
private async Task<int> InternalUpdate<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression, bool async = false)
where TEntity : class
#else
private int InternalUpdate<TEntity>(ObjectContext objectContext, EntityMap entityMap, ObjectQuery<TEntity> query, Expression<Func<TEntity, TEntity>> updateExpression, bool async = false)
where TEntity : class
#endif
{
DbConnection updateConnection = null;
DbTransaction updateTransaction = null;
Expand Down Expand Up @@ -341,10 +365,13 @@ private async Task<int> InternalUpdate<TEntity>(ObjectContext objectContext, Ent

updateCommand.CommandText = sqlBuilder.ToString();

#if net45
int result = async
? await updateCommand.ExecuteNonQueryAsync()
: updateCommand.ExecuteNonQuery();

#else
int result = updateCommand.ExecuteNonQuery();
#endif
// only commit if created transaction
if (ownTransaction)
updateTransaction.Commit();
Expand Down Expand Up @@ -411,7 +438,7 @@ private static string GetSelectSql<TEntity>(ObjectQuery<TEntity> query, EntityMa
{
var parameter = command.CreateParameter();
parameter.ParameterName = objectParameter.Name;
parameter.Value = objectParameter.Value ?? DBNull.Value;
parameter.Value = objectParameter.Value ?? DBNull.Value;

command.Parameters.Add(parameter);
}
Expand Down
4 changes: 3 additions & 1 deletion Source/EntityFramework.Extended/Caching/CacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public virtual object GetOrAdd(CacheKey cacheKey, Func<CacheKey, object> valueFa
return item;
}

#if net45
/// <summary>
/// Gets the cache value for the specified key that is already in the dictionary or the new value for the key as returned asynchronously by <paramref name="valueFactory"/>.
/// </summary>
Expand All @@ -303,6 +304,7 @@ public virtual Task<object> GetOrAddAsync(CacheKey cacheKey, Func<CacheKey, Task

return item;
}
#endif

/// <summary>
/// Removes a cache entry from the cache.
Expand All @@ -314,7 +316,7 @@ public object Remove(string key)
var cacheKey = new CacheKey(key);
return Remove(cacheKey);
}

/// <summary>
/// Removes a cache entry from the cache.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/EntityFramework.Extended/Caching/ICacheProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public interface ICacheProvider
/// </returns>
object GetOrAdd(CacheKey cacheKey, Func<CacheKey, object> valueFactory, CachePolicy cachePolicy);

#if net45
/// <summary>
/// Gets the cache value for the specified key that is already in the dictionary or the new value for the key as returned asynchronously by <paramref name="valueFactory"/>.
/// </summary>
Expand All @@ -51,6 +52,7 @@ public interface ICacheProvider
/// or the new value for the key as returned by <paramref name="valueFactory"/> if the key was not in the cache.
/// </returns>
Task<object> GetOrAddAsync(CacheKey cacheKey, Func<CacheKey, Task<object>> valueFactory, CachePolicy cachePolicy);
#endif

/// <summary>
/// Removes a cache entry from the cache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public object GetOrAdd(CacheKey cacheKey, Func<CacheKey, object> valueFactory, C
return value;
}

#if net45
/// <summary>
/// Gets the cache value for the specified key that is already in the dictionary or the new value for the key as returned asynchronously by <paramref name="valueFactory"/>.
/// </summary>
Expand Down Expand Up @@ -107,6 +108,7 @@ public async Task<object> GetOrAddAsync(CacheKey cacheKey, Func<CacheKey, Task<o

return value;
}
#endif

/// <summary>
/// Removes a cache entry from the cache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@
<AssemblyOriginatorKeyFile>..\EntityFramework.Extended.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.dll</HintPath>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.0\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.0\lib\net40\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down Expand Up @@ -145,9 +147,7 @@
<None Include="Audit\Audit.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Loading