/* Options: Date: 2024-11-24 02:07:18 SwiftVersion: 5.0 Version: 6.111 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://northwind.netcore.io //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: QueryOrders.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/query/orders") public class QueryOrders : QueryDb, IReturn { public typealias Return = QueryResponse public var freight:Double? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case freight } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) freight = try container.decodeIfPresent(Double.self, forKey: .freight) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if freight != nil { try container.encode(freight, forKey: .freight) } } } // @DataContract public class Order : Codable { // @DataMember public var id:Int // @DataMember public var customerId:String // @DataMember public var employeeId:Int // @DataMember public var orderDate:Date? // @DataMember public var requiredDate:Date? // @DataMember public var shippedDate:Date? // @DataMember public var shipVia:Int? // @DataMember public var freight:Double // @DataMember public var shipName:String // @DataMember public var shipAddress:String // @DataMember public var shipCity:String // @DataMember public var shipRegion:String // @DataMember public var shipPostalCode:String // @DataMember public var shipCountry:String required public init(){} }