Philipp Heenemann
a8b91f4ee6
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.
19 lines
478 B
C#
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);
|
|
} |