diff --git a/src/Umbraco.Core/DelegateEqualityComparer.cs b/src/Umbraco.Abstractions/DelegateEqualityComparer.cs similarity index 100% rename from src/Umbraco.Core/DelegateEqualityComparer.cs rename to src/Umbraco.Abstractions/DelegateEqualityComparer.cs diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs b/src/Umbraco.Abstractions/Direction.cs similarity index 58% rename from src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs rename to src/Umbraco.Abstractions/Direction.cs index 5c34413763..7d3906ffd0 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs +++ b/src/Umbraco.Abstractions/Direction.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core { public enum Direction { diff --git a/src/Umbraco.Core/EnumerableExtensions.cs b/src/Umbraco.Abstractions/EnumerableExtensions.cs similarity index 89% rename from src/Umbraco.Core/EnumerableExtensions.cs rename to src/Umbraco.Abstractions/EnumerableExtensions.cs index 3719bb0750..cee8199a6c 100644 --- a/src/Umbraco.Core/EnumerableExtensions.cs +++ b/src/Umbraco.Abstractions/EnumerableExtensions.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; namespace Umbraco.Core { @@ -10,6 +9,45 @@ namespace Umbraco.Core /// public static class EnumerableExtensions { + // based upon the original Zip method + public static IEnumerable Zip(this IEnumerable e1, IEnumerable e2, IEnumerable e3, + Func resultSelector) + { + if (e1 == null) throw new ArgumentNullException("e1"); + if (e2 == null) throw new ArgumentNullException("e2"); + if (e3 == null) throw new ArgumentNullException("e3"); + if (resultSelector == null) throw new ArgumentNullException("resultSelector"); + return ZipIterator(e1, e2, e3, resultSelector); + } + + private static IEnumerable ZipIterator(IEnumerable ie1, IEnumerable ie2, IEnumerable ie3, + Func resultSelector) + { + var e1 = ie1.GetEnumerator(); + try + { + var e2 = ie2.GetEnumerator(); + var e3 = ie3.GetEnumerator(); + try + { + while (e1.MoveNext() && e2.MoveNext() && e3.MoveNext()) + yield return resultSelector(e1.Current, e2.Current, e3.Current); + } + finally + { + if (e2 != null) + e2.Dispose(); + if (e3 != null) + e3.Dispose(); + } + } + finally + { + if (e1 != null) + e1.Dispose(); + } + } + internal static bool HasDuplicates(this IEnumerable items, bool includeNull) { var hs = new HashSet(); diff --git a/src/Umbraco.Core/IfExtensions.cs b/src/Umbraco.Abstractions/IfExtensions.cs similarity index 100% rename from src/Umbraco.Core/IfExtensions.cs rename to src/Umbraco.Abstractions/IfExtensions.cs diff --git a/src/Umbraco.Core/ListExtensions.cs b/src/Umbraco.Core/ListExtensions.cs deleted file mode 100644 index e639cbd5c7..0000000000 --- a/src/Umbraco.Core/ListExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Umbraco.Core -{ - /// - /// Provides extensions to the List type. - /// - internal static class ListExtensions - { - // based upon the original Zip method - public static IEnumerable Zip(this IEnumerable e1, IEnumerable e2, IEnumerable e3, - Func resultSelector) - { - if (e1 == null) throw new ArgumentNullException("e1"); - if (e2 == null) throw new ArgumentNullException("e2"); - if (e3 == null) throw new ArgumentNullException("e3"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - return ZipIterator(e1, e2, e3, resultSelector); - } - - private static IEnumerable ZipIterator(IEnumerable ie1, IEnumerable ie2, IEnumerable ie3, - Func resultSelector) - { - var e1 = ie1.GetEnumerator(); - try - { - var e2 = ie2.GetEnumerator(); - var e3 = ie3.GetEnumerator(); - try - { - while (e1.MoveNext() && e2.MoveNext() && e3.MoveNext()) - yield return resultSelector(e1.Current, e2.Current, e3.Current); - } - finally - { - if (e2 != null) - e2.Dispose(); - if (e3 != null) - e3.Dispose(); - } - } - finally - { - if (e1 != null) - e1.Dispose(); - } - } - } -} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index b37033542b..da3d18f5e8 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -560,7 +560,6 @@ - @@ -590,7 +589,6 @@ - @@ -651,7 +649,6 @@ - @@ -670,7 +667,6 @@ - @@ -941,7 +937,6 @@ - diff --git a/src/Umbraco.Tests/Logging/LogviewerTests.cs b/src/Umbraco.Tests/Logging/LogviewerTests.cs index 35981f5368..6139ca331e 100644 --- a/src/Umbraco.Tests/Logging/LogviewerTests.cs +++ b/src/Umbraco.Tests/Logging/LogviewerTests.cs @@ -3,9 +3,9 @@ using NUnit.Framework; using System; using System.IO; using System.Linq; +using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Logging.Viewer; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; namespace Umbraco.Tests.Logging { diff --git a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs index de970c900d..49e48e0a2f 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs @@ -2,15 +2,12 @@ using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Persistence; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Dtos; -using Umbraco.Core.Persistence.Querying; -using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.Repositories.Implement; using Umbraco.Core.Scoping; -using Umbraco.Core.Logging; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; +using Umbraco.Core; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs index 1d9cf6d022..3ece9bb6b3 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs @@ -3,20 +3,18 @@ using System.Linq; using Moq; using NUnit.Framework; using Umbraco.Core.Cache; -using Umbraco.Core.Configuration.UmbracoSettings; -using Umbraco.Core.IO; using Umbraco.Core.Models; using Umbraco.Core.Models.Entities; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Dtos; using Umbraco.Core.Persistence.Repositories.Implement; using Umbraco.Core.Scoping; using Umbraco.Tests.Testing; using Umbraco.Core.Services; +using Umbraco.Core; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index 5f3e84916b..83971ae682 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -199,7 +199,7 @@ namespace Umbraco.Web.Editors }, { "logApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( - controller => controller.GetPagedEntityLog(0, 0, 0, Core.Persistence.DatabaseModelDefinitions.Direction.Ascending, null)) + controller => controller.GetPagedEntityLog(0, 0, 0, Direction.Ascending, null)) }, { "memberApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( diff --git a/src/Umbraco.Web/Editors/LogController.cs b/src/Umbraco.Web/Editors/LogController.cs index c3e3790378..bfd82f8478 100644 --- a/src/Umbraco.Web/Editors/LogController.cs +++ b/src/Umbraco.Web/Editors/LogController.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using Umbraco.Core; using Umbraco.Core.Models; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; diff --git a/src/Umbraco.Web/Editors/LogViewerController.cs b/src/Umbraco.Web/Editors/LogViewerController.cs index e5c75926f6..6f7669de28 100644 --- a/src/Umbraco.Web/Editors/LogViewerController.cs +++ b/src/Umbraco.Web/Editors/LogViewerController.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Web.Http; +using Umbraco.Core; using Umbraco.Core.Logging.Viewer; using Umbraco.Core.Models; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi;