|
30 | 30 | /// Initializes a new instance of the {{classname}} class |
31 | 31 | /// with a {{#lambdaCref}}{{{dataType}}}{{/lambdaCref}} |
32 | 32 | /// </summary> |
33 | | - /// <param name="actualInstance">An instance of {{dataType}}.</param> |
| 33 | + /// <param name="actualInstance">An instance of {{{dataType}}}.</param> |
34 | 34 | public {{classname}}({{{dataType}}} actualInstance) |
35 | 35 | { |
36 | 36 | ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}}{{^allowableValues}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/allowableValues}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; |
|
44 | 44 | /// Initializes a new instance of the {{classname}} class |
45 | 45 | /// with a {{#lambdaCref}}{{{dataType}}}{{/lambdaCref}} |
46 | 46 | /// </summary> |
47 | | - /// <param name="actualInstance">An instance of {{dataType}}.</param> |
| 47 | + /// <param name="actualInstance">An instance of {{{dataType}}}.</param> |
48 | 48 | public {{classname}}(object actualInstance) |
49 | 49 | { |
50 | 50 | ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}}{{^allowableValues}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/allowableValues}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; |
|
65 | 65 | /// the InvalidClassException will be thrown{{/lambda.escape-generic}} |
66 | 66 | /// </summary> |
67 | 67 | /// <returns>An instance of {{#lambda.escape-generic}}{{dataType}}{{/lambda.escape-generic}}</returns> |
68 | | - public {{{dataType}}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}} As{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#lambda.titlecase}}{{{items.dataType}}}{{/lambda.titlecase}}() |
| 68 | + public {{{dataType}}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}} As{{#lambda.type-to-name}}{{{datatypeWithEnum}}}{{/lambda.type-to-name}}() |
69 | 69 | { |
70 | 70 | return ({{{dataType}}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}})ActualInstance; |
71 | 71 | } |
|
81 | 81 | /// {{#lambda.escape-generic}}Check if the actual instance is of `{{{dataType}}}` type.{{/lambda.escape-generic}} |
82 | 82 | /// </summary> |
83 | 83 | /// <returns>Whether or not the instance is the type</returns> |
84 | | - public bool Is{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#lambda.titlecase}}{{{items.dataType}}}{{/lambda.titlecase}}() |
| 84 | + public bool Is{{#lambda.type-to-name}}{{{datatypeWithEnum}}}{{/lambda.type-to-name}}() |
85 | 85 | { |
86 | 86 | return ActualInstance.GetType() == typeof({{{dataType}}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}}); |
87 | 87 | } |
|
0 commit comments