diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs index b3cacb2f95..4aced4378c 100644 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions; namespace Umbraco.Core.Migrations.Expressions.Delete.Index { public class DeleteIndexBuilder : ExpressionBuilderBase, - IDeleteIndexForTableBuilder, IDeleteIndexOnColumnBuilder + IDeleteIndexForTableBuilder, IExecutableBuilder { public DeleteIndexBuilder(DeleteIndexExpression expression) : base(expression) @@ -14,28 +14,10 @@ namespace Umbraco.Core.Migrations.Expressions.Delete.Index /// public void Do() => Expression.Execute(); - public IndexColumnDefinition CurrentColumn { get; set; } - - public IDeleteIndexOnColumnBuilder OnTable(string tableName) + public IExecutableBuilder OnTable(string tableName) { Expression.Index.TableName = tableName; return this; } - - /// - public IExecutableBuilder OnColumn(string columnName) - { - var column = new IndexColumnDefinition { Name = columnName }; - Expression.Index.Columns.Add(column); - return new ExecutableBuilder(Expression); - } - - /// - public IExecutableBuilder OnColumns(params string[] columnNames) - { - foreach (string columnName in columnNames) - Expression.Index.Columns.Add(new IndexColumnDefinition { Name = columnName }); - return new ExecutableBuilder(Expression); - } } } diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs index 8501c6b02f..8251107cbb 100644 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Migrations.Expressions.Delete.Index +using Umbraco.Core.Migrations.Expressions.Common; + +namespace Umbraco.Core.Migrations.Expressions.Delete.Index { /// /// Builds a Delete expression. @@ -8,6 +10,6 @@ /// /// Specifies the table of the index to delete. /// - IDeleteIndexOnColumnBuilder OnTable(string tableName); + IExecutableBuilder OnTable(string tableName); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs deleted file mode 100644 index 3aa877bf8e..0000000000 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Umbraco.Core.Migrations.Expressions.Common; - -namespace Umbraco.Core.Migrations.Expressions.Delete.Index -{ - /// - /// Builds a Delete expression. - /// - public interface IDeleteIndexOnColumnBuilder : IFluentBuilder, IExecutableBuilder - { - /// - /// Specifies the column of the index. - /// - [Obsolete("I don't think this would ever be used when dropping an index, see DeleteIndexExpression.ToString")] - IExecutableBuilder OnColumn(string columnName); - - /// - /// Specifies the column of the index. - /// - [Obsolete("I don't think this would ever be used when dropping an index, see DeleteIndexExpression.ToString")] - IExecutableBuilder OnColumns(params string[] columnNames); - } -} diff --git a/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs b/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs deleted file mode 100644 index ea6d5142f0..0000000000 --- a/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Umbraco.Core.Persistence -{ - /// - /// An exception used to indicate that an Umbraco entity could not be found. - /// - /// - [Obsolete("Instead of throwing an exception, return null or an HTTP 404 status code instead.")] - [Serializable] - public class EntityNotFoundException : Exception - { - /// - /// Gets the identifier. - /// - /// - /// The identifier. - /// - /// - /// This object should be serializable to prevent a to be thrown. - /// - public object Id { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public EntityNotFoundException() - { } - - /// - /// Initializes a new instance of the class. - /// - /// The identifier. - /// The message. - public EntityNotFoundException(object id, string message) - : base(message) - { - Id = id; - } - - /// - /// Initializes a new instance of the class. - /// - /// The message that describes the error. - public EntityNotFoundException(string message) - : base(message) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference ( in Visual Basic) if no inner exception is specified. - public EntityNotFoundException(string message, Exception innerException) - : base(message, innerException) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - protected EntityNotFoundException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - Id = info.GetValue(nameof(Id), typeof(object)); - } - - /// - /// When overridden in a derived class, sets the with information about the exception. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - /// info - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - if (info == null) - { - throw new ArgumentNullException(nameof(info)); - } - - info.AddValue(nameof(Id), Id); - - base.GetObjectData(info, context); - } - - /// - /// Returns a that represents this instance. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - var result = base.ToString(); - - if (Id != null) - { - return "Umbraco entity (id: " + Id + ") not found. " + result; - } - - return result; - } - } -}