AB4227 - Moved Persistence Root

This commit is contained in:
Bjarke Berg
2019-12-17 16:07:19 +01:00
parent 7a0e0f7782
commit 03631a1731
19 changed files with 0 additions and 18 deletions

View File

@@ -0,0 +1,29 @@
using System.Data;
namespace Umbraco.Core.Persistence
{
internal static class DbCommandExtensions
{
/// <summary>
/// Unwraps a database command.
/// </summary>
/// <remarks>UmbracoDatabase wraps the original database connection in various layers (see
/// OnConnectionOpened); this unwraps and returns the original database command.</remarks>
public static IDbCommand UnwrapUmbraco(this IDbCommand command)
{
IDbCommand unwrapped;
var c = command;
do
{
unwrapped = c;
var profiled = unwrapped as StackExchange.Profiling.Data.ProfiledDbCommand;
if (profiled != null) unwrapped = profiled.InternalCommand;
} while (c != unwrapped);
return unwrapped;
}
}
}