Merge branch 'umbplfest-hackathon-remove-obsolete' of https://github.com/AnthonyCogworks/Umbraco-CMS into AnthonyCogworks-umbplfest-hackathon-remove-obsolete
This commit is contained in:
@@ -92,18 +92,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The flatten list.</summary>
|
||||
/// <param name="e">The items.</param>
|
||||
/// <param name="f">The select child.</param>
|
||||
/// <typeparam name="T">Item type</typeparam>
|
||||
/// <returns>list of TItem</returns>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("Do not use, use SelectRecursive instead which has far less potential of re-iterating an iterator which may cause significantly more SQL queries")]
|
||||
public static IEnumerable<T> FlattenList<T>(this IEnumerable<T> e, Func<T, IEnumerable<T>> f)
|
||||
{
|
||||
return e.SelectMany(c => f(c).FlattenList(f)).Concat(e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if all items in the other collection exist in this collection
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
@@ -38,7 +39,7 @@ namespace Umbraco.Tests.CoreThings
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Flatten_List_2()
|
||||
public void SelectRecursive_2()
|
||||
{
|
||||
var hierarchy = new TestItem("1")
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace Umbraco.Tests.CoreThings
|
||||
};
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
var flattened = hierarchy.Children.FlattenList(x => x.Children);
|
||||
var flattened = FlattenList(hierarchy.Children, x => x.Children);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
var selectRecursive = hierarchy.Children.SelectRecursive(x => x.Children);
|
||||
|
||||
@@ -62,7 +63,7 @@ namespace Umbraco.Tests.CoreThings
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Flatten_List()
|
||||
public void SelectRecursive()
|
||||
{
|
||||
var hierarchy = new TestItem("1")
|
||||
{
|
||||
@@ -118,7 +119,7 @@ namespace Umbraco.Tests.CoreThings
|
||||
};
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
var flattened = hierarchy.Children.FlattenList(x => x.Children);
|
||||
var flattened = FlattenList(hierarchy.Children, x => x.Children);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
var selectRecursive = hierarchy.Children.SelectRecursive(x => x.Children);
|
||||
|
||||
@@ -141,6 +142,13 @@ namespace Umbraco.Tests.CoreThings
|
||||
public IEnumerable<TestItem> Children { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private IEnumerable<T> FlattenList<T>(IEnumerable<T> e, Func<T, IEnumerable<T>> f)
|
||||
{
|
||||
return e.SelectMany(c => FlattenList(f(c), f)).Concat(e);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InGroupsOf_ReturnsAllElements()
|
||||
{
|
||||
|
||||
@@ -74,25 +74,6 @@ namespace Umbraco.Web.Cache
|
||||
|
||||
#endregion
|
||||
|
||||
#region User group permissions cache
|
||||
|
||||
public static void RemoveUserGroupPermissionsCache(this DistributedCache dc, int groupId)
|
||||
{
|
||||
dc.Remove(UserGroupPermissionsCacheRefresher.UniqueId, groupId);
|
||||
}
|
||||
|
||||
public static void RefreshUserGroupPermissionsCache(this DistributedCache dc, int groupId)
|
||||
{
|
||||
//TODO: Not sure if we need this yet depends if we start caching permissions
|
||||
//dc.Refresh(UserGroupPermissionsCacheRefresher.UniqueId, groupId);
|
||||
}
|
||||
|
||||
public static void RefreshAllUserGroupPermissionsCache(this DistributedCache dc)
|
||||
{
|
||||
dc.RefreshAll(UserGroupPermissionsCacheRefresher.UniqueId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TemplateCache
|
||||
|
||||
|
||||
@@ -226,13 +226,7 @@ namespace Umbraco.Web.Editors
|
||||
};
|
||||
}
|
||||
|
||||
[Obsolete("Use GetyById instead")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public EntityBasic GetByKey(Guid id, UmbracoEntityTypes type)
|
||||
{
|
||||
return GetResultForKey(id, type);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets an entity by a xpath query
|
||||
/// </summary>
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
<Compile Include="AspNetHttpContextAccessor.cs" />
|
||||
<Compile Include="Cache\ContentCacheRefresher.cs" />
|
||||
<Compile Include="Cache\UserGroupCacheRefresher.cs" />
|
||||
<Compile Include="Cache\UserGroupPermissionsCacheRefresher.cs" />
|
||||
<Compile Include="Components\BackOfficeUserAuditEventsComponent.cs" />
|
||||
<Compile Include="Editors\BackOfficePreviewModel.cs" />
|
||||
<Compile Include="Media\Exif\BitConverterEx.cs" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
@@ -14,7 +13,6 @@ using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models.Packaging;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Services.Implement;
|
||||
using Umbraco.Core.Xml;
|
||||
using File = System.IO.File;
|
||||
@@ -115,11 +113,7 @@ namespace umbraco.cms.businesslogic.packager
|
||||
ContainsStyleSheeConflicts = false;
|
||||
}
|
||||
|
||||
[Obsolete("Use the ctor with all parameters")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public Installer(string name, string version, string url, string license, string licenseUrl, string author, string authorUrl, int requirementsMajor, int requirementsMinor, int requirementsPatch, string readme, string control)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
|
||||
Reference in New Issue
Block a user