You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fb41e3a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: templates/modelAnyOf.mustache
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -73,15 +73,12 @@
73
73
{{^vendorExtensions.x-duplicated-data-type}}
74
74
{{^isNull}}
75
75
76
+
{{^isAnyType}}{{^isFreeFormObject}}
76
77
/// <summary>
77
-
/// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`,
78
-
/// the InvalidClassException will be thrown
78
+
/// Converts to the <c>{{dataType}}</c> this instance holds, throwing <seecref="InvalidCastException"/> when it holds another type.
79
79
/// </summary>
80
-
/// <returns>An instance of {{dataType}}</returns>
81
-
public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}()
82
-
{
83
-
return ({{{dataType}}})ActualInstance;
84
-
}
80
+
public static implicit operator {{{dataType}}}({{classname}} value) => ({{{dataType}}})value?.ActualInstance;
Copy file name to clipboardExpand all lines: templates/modelOneOf.mustache
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -73,15 +73,12 @@
73
73
{{^vendorExtensions.x-duplicated-data-type}}
74
74
{{^isNull}}
75
75
76
+
{{^isAnyType}}{{^isFreeFormObject}}
76
77
/// <summary>
77
-
/// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`,
78
-
/// the InvalidClassException will be thrown
78
+
/// Converts to the <c>{{dataType}}</c> this instance holds, throwing <seecref="InvalidCastException"/> when it holds another type.
79
79
/// </summary>
80
-
/// <returns>An instance of {{dataType}}</returns>
81
-
public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}()
82
-
{
83
-
return ({{{dataType}}})this.ActualInstance;
84
-
}
80
+
public static implicit operator {{{dataType}}}({{classname}} value) => ({{{dataType}}})value?.ActualInstance;
0 commit comments