diff --git a/LibraryApp.Domain/Services/Result.cs b/LibraryApp.Domain/Services/Result.cs new file mode 100644 index 0000000..7bf8e84 --- /dev/null +++ b/LibraryApp.Domain/Services/Result.cs @@ -0,0 +1,14 @@ +using LibraryApp.Domain; + +namespace LibraryApp.Services; + +public record Result +{ + public required bool IsSuccess { get; init; } + public Error? ErrorMessage { get; init; } + + private Result() { } + + public static Result Success() => new Result { IsSuccess = true }; + public static Result Failure(string errorMessage) => new Result { IsSuccess = false, ErrorMessage = errorMessage }; +}