Next, we will add a data contract model, a Product
data contract, and a Product Fault
contract to the model.
ProductID (Int32), ProductName (String), QuantityPerUnit (String), UnitPrice (Decimal)
, and Discontinued (Boolean)
.In this model, we didn't specify the unit price as type Decimal?
, even though it should really be Decimal?
. This is because Service Factory doesn't support nullable data types.
Also, we didn't add LastUpdateVersion
as a data member, even though we need to pass this member to the client to that when the product is passed back, we can check if this product has been updated by other applications. The reason why we didn't include this data member in the model is that Service Factory doesn't support Binary
data types.
We will adjust these two data members in the data contract in a later section, after we have generated the source code.
The detailed steps, and the final data contract model should be the same as described in Chapter 7. To refresh your memory, your data contract model should look like this: