// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications //====================================================================================================== // The HoldingDataModel class, part of the DataContract for the StockTrader Business Services Layer. //====================================================================================================== using System; using System.Collections; using System.Runtime.Serialization; using System.ServiceModel; namespace Trade.BusinessServiceDataContract { /// /// This class is part of the WCF Data Contract for StockTrader Business Services. /// It defines the class used as the data model for holding information. /// [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://trade.samples.websphere.ibm.com",TypeName="HoldingDataBean")] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Namespace = "http://trade.samples.websphere.ibm.com",Name="HoldingDataBean")] public sealed class HoldingDataModel { private int _accountID; private int _holdingID; private double _quantity; private decimal _purchasePrice; private DateTime _purchaseDate; private string _quoteID; public HoldingDataModel() { } public HoldingDataModel(int holdingID, int accountID, double quantity, decimal purchasePrice, DateTime purchaseDate, string quoteID) { this._holdingID = holdingID; this._accountID = accountID; this._quantity = quantity; this._purchasePrice = purchasePrice; this._purchaseDate = purchaseDate; this._quoteID = quoteID; } public HoldingDataModel(int holdingID, double quantity, decimal purchasePrice, DateTime purchaseDate, string quoteID, int accountID) { this._holdingID = holdingID; this._accountID = accountID; this._quantity = quantity; this._purchasePrice = purchasePrice; this._purchaseDate = purchaseDate; this._quoteID = quoteID; } [System.Xml.Serialization.XmlIgnore] public int AccountID { get { return _accountID; } set { this._accountID = value; } } [System.Xml.Serialization.XmlElementAttribute(ElementName = "holdingID", Order = 1, IsNullable = false)] [DataMember(IsRequired = false, Name = "holdingID", Order = 1)] public int holdingID { get { return _holdingID; } set { this._holdingID = value; } } [System.Xml.Serialization.XmlElementAttribute(ElementName = "quantity", Order = 2, IsNullable = false)] [DataMember(IsRequired = false, Name = "quantity", Order = 2)] public double quantity { get { return _quantity; } set { this._quantity = value; } } [System.Xml.Serialization.XmlElementAttribute(ElementName = "purchasePrice", Order = 3, IsNullable = false)] [DataMember(IsRequired = false, Name = "purchasePrice", Order = 3)] public decimal purchasePrice { get { return _purchasePrice; } set { this._purchasePrice = value; } } [System.Xml.Serialization.XmlElementAttribute(ElementName = "purchaseDate", Order = 4, IsNullable = false)] [DataMember(IsRequired = false, Name = "purchaseDate", Order = 4)] public DateTime purchaseDate { get { return _purchaseDate; } set { this._purchaseDate = value; } } [System.Xml.Serialization.XmlElementAttribute(ElementName = "quoteID", Order = 5, IsNullable = false)] [DataMember(IsRequired = false, Name = "quoteID", Order = 5)] public string quoteID { get { return _quoteID; } set { this._quoteID = value; } } } }