New Posts New Posts RSS Feed: Protected Properties cannot be set in 5.2.2
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Forum LockedProtected Properties cannot be set in 5.2.2

 Post Reply Post Reply
Author
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Topic: Protected Properties cannot be set in 5.2.2
    Posted: 21-Sep-2009 at 11:45pm
Hi,
 
I have a protected property and a protected navigation property.
The idea of making them protected is to disallow any direct modifications from other assemblies, like from the UI.
This has always been working in 5.1.0, I am able to set them from within the DomainModel partial class.
 
After porting to 5.2.2, I have exceptions because even my DomainModel partial class cannot set its protected member data.
 
The DomainModel....Designer.cs shows the following property:
    #region SomeProtectedName
    /// <summary>Gets or sets the SomeProtectedName.</summary>
    [Bindable(true, BindingDirection.TwoWay)]
    [Editable(true)]
    [Display(Name="SomeProtectedName", AutoGenerateField=true)]
    [IbVal.ValidateProperty]
    [IbCore.DBDataType(typeof(String))]
    [MsSer.DataMember]
    public String SomeProtectedName {
       get { return SomeProtectedNameEntityProperty.GetValue(this); }
       [global::System.Diagnostics.DebuggerNonUserCode]
      protected set { SomeProtectedNameEntityProperty.SetValue(this, value); }
    }
    #endregion SomeProtectedName
 
Exception "Cannot set property: Password.  It is a readonly property" will be thrown if you attempt to assign it in DomainModel partial class.
 
The DomainModel....Designer.cs shows the following Navigation property:
    #region HeadPerson
    /// <summary>Gets or sets the HeadPerson.</summary>
    [Bindable(false)]
    [Display(AutoGenerateField=false)]
    [MsSer.DataMember]
    [IbEm.RelationProperty("FK_Organisation_HeadPerson", IbEm.QueryDirection.ToRole1)]
    public Person HeadPerson {
       get { return HeadPersonEntityProperty.GetValue(this); }
       [global::System.Diagnostics.DebuggerNonUserCode]
      protected set { HeadPersonEntityProperty.SetValue(this, value); }
    }
    #endregion HeadPerson
 
A null reference exception will be thrown if you attempt to assign it in DomainModel partial class.
 
Is this expected in 5.2.2 ?
 
Regards
Sebastian
 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1390
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 22-Sep-2009 at 3:22pm
This was not expected or intentional in v 5.2.2, and has been fixed in current bits (v5.2.3 is coming in mid October).
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down