为什么我不能从我的IService使用我的数据合同?

时间:2013-05-04 18:59:37

标签: c# wcf networking datacontract datamember

我在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; }
}

但从我使用此界面的服务中只能看到PumpClassDieselTankUnleadedTank,我不知道为什么。只有这三个显示在Visual Studio的数据源中。

0 个答案:

没有答案