Skip to content

Commit

Permalink
Fix issue from v1.4.6
Browse files Browse the repository at this point in the history
Fix issue from v1.4.6
  • Loading branch information
zzzprojects committed Oct 4, 2016
1 parent 297dbf8 commit 6f1cb08
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("e4c2af73-caeb-4429-bcb6-0a359484e064")]
[assembly: AssemblyVersion("1.4.6")]
[assembly: AssemblyFileVersion("1.4.6")]
[assembly: AssemblyVersion("1.4.7")]
[assembly: AssemblyFileVersion("1.4.7")]
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static string GetCacheKey(IQueryable query, string[] tags)

if (queryCacheUniqueKeyMethod != null)
{
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, null);
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, new object[] { tags });

if (!string.IsNullOrEmpty(queryCacheUniqueKey))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ public IQueryable Include(string path)
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var cacheKey = new StringBuilder();

var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, new string[0]);
var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, tags);

if (QueryCacheManager.UseFirstTagAsCacheKey || QueryCacheManager.UseTagsAsCacheKey)
{
// ONLY need to resolve once
return mainKey;
}

// ADD query main
cacheKey.AppendLine("Query Main");
Expand All @@ -174,7 +180,7 @@ public string GetQueryCacheUniqueKey()
for (var i = 0; i < Childs.Count; i++)
{
var child = Childs[i].GetFilteredQuery(OriginalQueryable);
var childKey = QueryCacheManager.GetCacheKey(child, new string[0]);
var childKey = QueryCacheManager.GetCacheKey(child, tags);

// ADD query child
cacheKey.AppendLine("Query Child: " + i);
Expand Down
4 changes: 2 additions & 2 deletions src/Z.EntityFramework.Plus.EF5/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("abcbb878-043c-4957-a334-90e9872e684e")]
[assembly: AssemblyVersion("1.4.6")]
[assembly: AssemblyFileVersion("1.4.6")]
[assembly: AssemblyVersion("1.4.7")]
[assembly: AssemblyFileVersion("1.4.7")]
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static string GetCacheKey(IQueryable query, string[] tags)

if (queryCacheUniqueKeyMethod != null)
{
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, null);
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, new object[] { tags });

if (!string.IsNullOrEmpty(queryCacheUniqueKey))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ public IQueryable Include(string path)
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var cacheKey = new StringBuilder();

var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, new string[0]);
var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, tags);

if (QueryCacheManager.UseFirstTagAsCacheKey || QueryCacheManager.UseTagsAsCacheKey)
{
// ONLY need to resolve once
return mainKey;
}

// ADD query main
cacheKey.AppendLine("Query Main");
Expand All @@ -174,7 +180,7 @@ public string GetQueryCacheUniqueKey()
for (var i = 0; i < Childs.Count; i++)
{
var child = Childs[i].GetFilteredQuery(OriginalQueryable);
var childKey = QueryCacheManager.GetCacheKey(child, new string[0]);
var childKey = QueryCacheManager.GetCacheKey(child, tags);

// ADD query child
cacheKey.AppendLine("Query Child: " + i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ac398eb8-0a31-4d06-a804-84d10b6da96d")]
[assembly: AssemblyVersion("1.4.6")]
[assembly: AssemblyFileVersion("1.4.6")]
[assembly: AssemblyVersion("1.4.7")]
[assembly: AssemblyFileVersion("1.4.7")]
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static string GetCacheKey(IQueryable query, string[] tags)

if (queryCacheUniqueKeyMethod != null)
{
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, null);
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, new object[] { tags });

if (!string.IsNullOrEmpty(queryCacheUniqueKey))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ public IQueryable CreateQueryable()
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var query = CreateQueryable();

return QueryCacheManager.GetCacheKey(query, new string[0]);
return QueryCacheManager.GetCacheKey(query, tags);
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ public IQueryable Include(string path)
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var cacheKey = new StringBuilder();

var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, new string[0]);
var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, tags);

if (QueryCacheManager.UseFirstTagAsCacheKey || QueryCacheManager.UseTagsAsCacheKey)
{
// ONLY need to resolve once
return mainKey;
}

// ADD query main
cacheKey.AppendLine("Query Main");
Expand All @@ -174,7 +180,7 @@ public string GetQueryCacheUniqueKey()
for (var i = 0; i < Childs.Count; i++)
{
var child = Childs[i].GetFilteredQuery(OriginalQueryable);
var childKey = QueryCacheManager.GetCacheKey(child, new string[0]);
var childKey = QueryCacheManager.GetCacheKey(child, tags);

// ADD query child
cacheKey.AppendLine("Query Child: " + i);
Expand Down
4 changes: 2 additions & 2 deletions src/Z.EntityFramework.Plus.EF6/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("89f47e22-ff83-4ac8-be90-c6755748cf89")]
[assembly: AssemblyVersion("1.4.6")]
[assembly: AssemblyFileVersion("1.4.6")]
[assembly: AssemblyVersion("1.4.7")]
[assembly: AssemblyFileVersion("1.4.7")]
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static string GetCacheKey(IQueryable query, string[] tags)

if (queryCacheUniqueKeyMethod != null)
{
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, null);
var queryCacheUniqueKey = (string)queryCacheUniqueKeyMethod.Invoke(query, new object[] { tags });

if (!string.IsNullOrEmpty(queryCacheUniqueKey))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ public IQueryable CreateQueryable()
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var query = CreateQueryable();

return QueryCacheManager.GetCacheKey(query, new string[0]);
return QueryCacheManager.GetCacheKey(query, tags);
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ public IQueryable Include(string path)
#if FULL
/// <summary>Gets query cache unique key.</summary>
/// <returns>The query cache unique key.</returns>
public string GetQueryCacheUniqueKey()
public string GetQueryCacheUniqueKey(string[] tags)
{
var cacheKey = new StringBuilder();

var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, new string[0]);
var mainKey = QueryCacheManager.GetCacheKey(OriginalQueryable, tags);

if (QueryCacheManager.UseFirstTagAsCacheKey || QueryCacheManager.UseTagsAsCacheKey)
{
// ONLY need to resolve once
return mainKey;
}

// ADD query main
cacheKey.AppendLine("Query Main");
Expand All @@ -174,7 +180,7 @@ public string GetQueryCacheUniqueKey()
for (var i = 0; i < Childs.Count; i++)
{
var child = Childs[i].GetFilteredQuery(OriginalQueryable);
var childKey = QueryCacheManager.GetCacheKey(child, new string[0]);
var childKey = QueryCacheManager.GetCacheKey(child, tags);

// ADD query child
cacheKey.AppendLine("Query Child: " + i);
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.6
v1.4.7

0 comments on commit 6f1cb08

Please sign in to comment.