sharee.bike-App/SharedBusinessLogic/Repository/AppContextInfo.cs

36 lines
880 B
C#
Raw Normal View History

2022-01-04 18:54:03 +01:00
using System;
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Repository
2022-01-04 18:54:03 +01:00
{
2022-09-06 16:08:19 +02:00
/// <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));
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
Version = version;
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
MerchantId = !string.IsNullOrEmpty(merchantId)
? merchantId
: throw new ArgumentNullException(nameof(merchantId));
}
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Name of the app. </summary>
public string Name { get; private set; }
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Version of the app.</summary>
public Version Version { get; private set; }
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Merchang id of the app. </summary>
public string MerchantId { get; private set; }
2022-01-04 18:54:03 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Returns http- user agent.</summary>
public string UserAgent { get => $"{Name}/{Version}"; }
}
2022-01-04 18:54:03 +01:00
}