mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-11-09 23:44:20 +01:00
17 lines
577 B
C#
Executable File
17 lines
577 B
C#
Executable File
using System;
|
|
|
|
namespace SharpRSS.API.Contracts.Models
|
|
{
|
|
public class ResultOr<TValue> : Result
|
|
{
|
|
public ResultOr(TValue? value, string message, ResultStatus status) : base(message, status)
|
|
{
|
|
Value = value;
|
|
}
|
|
|
|
public TValue? Value { get; }
|
|
|
|
public static ResultOr<TValue> Ok(TValue? value) => new ResultOr<TValue>(value, "", ResultStatus.Ok);
|
|
public static ResultOr<TValue> Failed(string message = "Failed", ResultStatus status = ResultStatus.Failed) => new ResultOr<TValue>(default, message, status);
|
|
}
|
|
} |