internal Result(bool isFailure, T value, string error) { if (!isFailure && value == null) { throw new ArgumentNullException(nameof(value)); } _logic = ResultCommonLogic.Create(isFailure, error); _value = value; }
public Result(SerializationInfo oInfo, StreamingContext oContext) { var isFailure = oInfo.GetBoolean("IsFailure"); if (isFailure) { var error = oInfo.GetString("Error"); _logic = ResultCommonLogic.Create(isFailure, error); _value = default; } else { _logic = ResultCommonLogic.Create(isFailure, null); var value = (T)oInfo.GetValue("Value", typeof(T)); _value = value; } }
internal Result(bool isFailure, T value, string error) { _logic = ResultCommonLogic.Create(isFailure, error); _value = value; }