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 }}
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
CA-267461: Fix powershell bindings generator for some constructors
The problem was in New-XenClusterHost.cs, we had the following code
generated:
```
[Parameter(ParameterSetName = "Fields")]
public XenRef<XenAPI.Cluster> Cluster { get; set; }
[Parameter(ParameterSetName = "Fields")]
public XenRef<XenAPI.Host> XenHost { get; set; }
...
if (Record != null)
{
Cluster = Record.cluster;
Host = Record.host;
}
```
where Cluster was being set correctly, but it was trying to assign
to Host rather than XenHost. The Hashtbl implementation slightly
further on was correct:
```
Cluster = Marshalling.ParseRef<Cluster>(HashTable, "cluster");
XenHost = Marshalling.ParseRef<Host>(HashTable, "host");
```
The fix it to use the code used in the Hashtbl part, which is a
call to `ocaml_class_to_csharp_property x` rather than
`exposed_class_name (pascal_case x)`. Turns out the implementation
of `ocaml_class_to_csharp_property` is:
```ocaml
let ocaml_class_to_csharp_property classname =
if (classname = "host") then "XenHost"
else (exposed_class_name (pascal_case classname))
```
Signed-off-by: Jon Ludlam <[email protected]>
0 commit comments