2024-04-09 12:53:23 +02:00
|
|
|
using System.Runtime.Serialization;
|
|
|
|
using Newtonsoft.Json;
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace ShareeBike.Repository.Response
|
2021-05-13 20:03:07 +02:00
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
[DataContract]
|
2024-04-09 12:53:23 +02:00
|
|
|
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
2022-09-06 16:08:19 +02:00
|
|
|
public class ResponseContainer<T>
|
|
|
|
{
|
|
|
|
[DataMember]
|
|
|
|
public T shareejson { get; private set; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Serializes object to string.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
if (shareejson == null)
|
|
|
|
{
|
|
|
|
return "Response container does not hold no entry.";
|
|
|
|
}
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
return shareejson.ToString();
|
|
|
|
}
|
|
|
|
}
|
2021-05-13 20:03:07 +02:00
|
|
|
}
|