// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; namespace Riskeer.Migration.Core { /// /// Class that provides properties for logging messages that occurred during migration. /// public class MigrationLogMessage { /// /// Creates a new instance of . /// /// The version migrated from. /// The version migrated to. /// The message during the migration. /// Throws when any of the input parameters is /// null or empty. public MigrationLogMessage(string fromVersion, string toVersion, string message) { if (string.IsNullOrEmpty(fromVersion)) { throw new ArgumentException($@"Parameter '{nameof(fromVersion)}' must contain a value", nameof(fromVersion)); } if (string.IsNullOrEmpty(toVersion)) { throw new ArgumentException($@"Parameter '{nameof(toVersion)}' must contain a value", nameof(toVersion)); } if (string.IsNullOrEmpty(message)) { throw new ArgumentException($@"Parameter '{nameof(message)}' must contain a value", nameof(message)); } FromVersion = fromVersion; ToVersion = toVersion; Message = message; } /// /// Gets the version that was migrated from. /// public string FromVersion { get; } /// /// Gets the version that was migrated to. /// public string ToVersion { get; } /// /// Gets the message occurred during the migration. /// public string Message { get; } } }