sharee.bike-App/SharedBusinessLogic/Repository/AppContextInfo.cs
2024-04-09 12:53:23 +02:00

35 lines
880 B
C#

using System;
namespace ShareeBike.Repository
{
/// <summary>
/// Holds info passed to COPRI.
/// </summary>
public class AppContextInfo
{
public AppContextInfo(string merchantId, string name, Version version)
{
Name = !string.IsNullOrEmpty(name)
? name
: throw new ArgumentNullException(nameof(name));
Version = version;
MerchantId = !string.IsNullOrEmpty(merchantId)
? merchantId
: throw new ArgumentNullException(nameof(merchantId));
}
/// <summary> Name of the app. </summary>
public string Name { get; private set; }
/// <summary> Version of the app.</summary>
public Version Version { get; private set; }
/// <summary> Merchang id of the app. </summary>
public string MerchantId { get; private set; }
/// <summary> Returns http- user agent.</summary>
public string UserAgent { get => $"{Name}/{Version}"; }
}
}