using System; using System.Runtime.Serialization; using Newtonsoft.Json; namespace ShareeBike.Repository.Response { [DataContract] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public class BikeInfoAvailable : BikeInfoBase, IEquatable { /// Mini survey for bikes which were rented before and for which feedback is pending. [DataMember] public MiniSurveyResponse user_miniquery { get; private set; } /// Information about Co2- saving for bikes which were rented before and for which feedback is pending. [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; } }