When adding a service reference to an OData service, the generated entities classes are made partial classes. This provides a useful extensibility point for extending the model, and for providing custom logic within entities themselves.
EbayModel.Item class, for example, contains a
TimeLeft property. This property is provided as a string. If it was of type
TimeSpan, however, it would be easier to work with.
This section creates a new partial
Item class and, within it, a
TimeSpan property that converts the string value provided by the OData service into a
The following is an example of the format used by the
The string contains tokens that indicate value positions ...