Philipp Heenemann a8b91f4ee6 Refactor C# code to imperative, top-level statements style
Updated the existing C# code into a more modern, imperative and top-level statements style. This involves shortening the code by removing unnecessary parts like additional brackets and explicit namespace declarations. It's done to improve clarity and readability.
2023-07-12 09:19:33 +02:00

19 lines
478 B
C#

using SPTInstaller.Interfaces;
namespace SPTInstaller.Models;
public class Result : IResult
{
public bool Succeeded { get; private set; }
public string Message { get; private set; }
protected Result(string message, bool succeeded)
{
Message = message;
Succeeded = succeeded;
}
public static Result FromSuccess(string message = "") => new(message, true);
public static Result FromError(string message) => new(message, false);
}