Skip to content

Issue when attribute has same name as entity #5

@xairrick

Description

@xairrick

mistake when generating classes.
Below I will give an example of the work of the standard mechanism of the utility.
[System.Runtime.Serialization.DataContractAttribute()]
[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("new_bankgroup")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "8.0.1.7297")]
public partial class new_BankGroup : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
{

[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("new_bankgroup")]
public string new_BankGroup1 // correct
{
get
{
return this.GetAttributeValue("new_bankgroup");
}
set
{
this.OnPropertyChanging("new_BankGroup1");
this.SetAttributeValue("new_bankgroup", value);
this.OnPropertyChanged("new_BankGroup1");
}
}

}

And you template.

[System.Runtime.Serialization.DataContractAttribute()]
[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("new_bankgroup")]
public partial class new_BankGroup : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
{
[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("new_bankgroup")]
public string new_BankGroup // error name property == name class
{
get
{
return this.GetAttributeValue("new_bankgroup");
}
set
{
this.OnPropertyChanging("new_BankGroup");
this.SetAttributeValue("new_bankgroup", value);
this.OnPropertyChanged("new_BankGroup");
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions