albanian-xrm / albanian-xrm/Xrm-Entity-Serializer

'System.InvalidCastException' with integers

Offen
#9 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
C#
Sterne
13
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Parts of my early-bound model have nullable `int`s. From the auto-generated Entities.cs class:

```
[System.Runtime.Serialization.DataContractAttribute()]
[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("psa_psasettings")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "8.0.1.7297")]
public partial class psa_psasettings : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
{
...
[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("psa_updatenumber")]
public System.Nullable psa_UpdateNumber
{
get
{
return this.GetAttributeValue>("psa_updatenumber");
}
set
{
this.OnPropertyChanging("psa_UpdateNumber");
this.SetAttributeValue("psa_updatenumber", value);
this.OnPropertyChanged("psa_UpdateNumber");
}
}
```

In the exported JSON backup of this entity, this is represented as:

![image](https://user-images.githubusercontent.com/12505024/164113030-6fcab3d7-04a0-4992-8338-4adbbbdf3489.png)

When I load the JSON file, this attribute has a `'System.InvalidCastException'`:

![image](https://user-images.githubusercontent.com/12505024/164113320-51fd9e4a-f361-4226-ac36-02d391eeef35.png)

This happens for every `int` in this model.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.