sharee.bike-App/TINKLib/Services/CopriApi/Result.cs
2021-05-13 20:03:07 +02:00

23 lines
770 B
C#

using System;
namespace TINK.Model.Services.CopriApi
{
public class Result<T> where T : class
{
public Result(Type source, T response, System.Exception exception = null)
{
Source = source ?? throw new ArgumentException(nameof(source));
Response = response ?? throw new ArgumentException(nameof(response));
Exception = exception;
}
/// <summary> Holds the copri respsonse</summary>
public T Response { get; }
/// <summary> Specifies the souce of the copri response.</summary>
public Type Source { get; }
/// <summary> Holds the exception if a communication error occurred.</summary>
public System.Exception Exception { get; private set; }
}
}