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

31 lines
1.2 KiB
C#

using System;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace ShareeBike.Repository.Response
{
[DataContract]
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class BikeInfoAvailable : BikeInfoBase, IEquatable<BikeInfoAvailable>
{
/// <summary>Mini survey for bikes which were rented before and for which feedback is pending.</summary>
[DataMember]
public MiniSurveyResponse user_miniquery { get; private set; }
/// <summary> Information about Co2- saving for bikes which were rented before and for which feedback is pending.</summary>
[DataMember]
public string co2saving { get; private set; }
public static bool operator ==(BikeInfoAvailable first, BikeInfoAvailable second)
=> JsonConvert.SerializeObject(first) == JsonConvert.SerializeObject(second);
public static bool operator !=(BikeInfoAvailable first, BikeInfoAvailable second)
=> !(first == second);
public override bool Equals(object obj) => obj is BikeInfoAvailable target && target == this;
public override int GetHashCode() => JsonConvert.SerializeObject(this).GetHashCode();
public bool Equals(BikeInfoAvailable other) => other == this;
}
}