Eerste commit

This commit is contained in:
jf
2026-09-27 14:21:31 +00:00
commit de4ff128cb
295 changed files with 47374 additions and 0 deletions
@@ -0,0 +1,26 @@
namespace MijnBesluit.Application.Models;
/// <summary>Uitkomst van een bewerking, met een foutmelding die direct aan de gebruiker getoond mag worden.</summary>
public readonly struct Result
{
public bool Succeeded { get; }
public string? Error { get; }
private Result(bool ok, string? error) { Succeeded = ok; Error = error; }
public static Result Ok() => new(true, null);
public static Result Fail(string error) => new(false, error);
}
/// <summary>Uitkomst met een waarde erbij.</summary>
public readonly struct Result<T>
{
public bool Succeeded { get; }
public string? Error { get; }
public T? Value { get; }
private Result(bool ok, T? value, string? error) { Succeeded = ok; Value = value; Error = error; }
public static Result<T> Ok(T value) => new(true, value, null);
public static Result<T> Fail(string error) => new(false, default, error);
}