/* Options: Date: 2024-12-22 21:15:22 SwiftVersion: 6.0 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: QueryGameItem.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack public class QueryGameItem : QueryDb, IReturn { public typealias Return = QueryResponse public var name:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } } } public class GameItem : AuditBase { // @StringLength(50) public var name:String? public var imageUrl:String? // @StringLength(Int32.max) public var Description:String? public var dateAdded:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case imageUrl case Description case dateAdded } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl) Description = try container.decodeIfPresent(String.self, forKey: .Description) dateAdded = try container.decodeIfPresent(Date.self, forKey: .dateAdded) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) } if Description != nil { try container.encode(Description, forKey: .Description) } if dateAdded != nil { try container.encode(dateAdded, forKey: .dateAdded) } } }