我的 IService 中定义了以下数据协定:
[DataContract]
public class PumpClass {
[DataMember]
public int ID { get; set; }
[DataMember]
public double litresPumped { get; set; }
[DataMember]
public double price { get; set; }
[DataMember]
public string fuelType { get; set; }
[DataMember]
public DateTime date { get; set; }
[DataMember]
public bool requestUse { get; set; }
[DataMember]
public bool requestAccepted { get; set; }
[DataMember]
public bool finished { get; set; }
}
[DataContract]
public class DieselTank {
[DataMember]
public double MaximumLevel { get; set; }
[DataMember]
public double WarningLevel { get; set; }
[DataMember]
public double CurrentLevel { get; set; }
[DataMember]
public bool OrderFuel { get; set; }
}
[DataContract]
public class UnleadedTank {
[DataMember]
public double MaximumLevel { get; set; }
[DataMember]
public double WarningLevel { get; set; }
[DataMember]
public double CurrentLevel { get; set; }
[DataMember]
public bool OrderFuel { get; set; }
}
[DataContract]
public class CostOfFuel {
[DataMember]
public double DieselSupplierPrice { get; set; }
[DataMember]
public double DieselPrice { get; set; }
[DataMember]
public double UnleadedSupplierPrice { get; set; }
[DataMember]
public double UnleadedPrice { get; set; }
}
[DataContract]
public class Sale {
[DataMember]
public double value { get; set; }
[DataMember]
public double volumeSold { get; set; }
[DataMember]
public DateTime dateSold { get; set; }
}
[DataContract]
public class Ordered {
[DataMember]
public double volume { get; set; }
[DataMember]
public double cost { get; set; }
}
但只有PumpClass
,DieselTank
并且UnleadedTank
可以从我使用此接口的服务中看到,我不知道为什么。只有这 3 个出现在 Visual Studio 的数据源中。