mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Implementing home page management
--HG-- branch : autoroute
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Orchard.Utility.Extensions {
|
||||
@@ -17,5 +19,22 @@ namespace Orchard.Utility.Extensions {
|
||||
|
||||
return newDictionary;
|
||||
}
|
||||
|
||||
public static bool Compare(this RouteValueDictionary x, RouteValueDictionary y) {
|
||||
if(x == y) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(x == null || y == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(x.Count != y.Count) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// keys can be different in case
|
||||
return x.Keys.All(key => x[key].ToString().Equals(y[key].ToString(), StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user