Source/Csla/Core/ManagedObjectBase.cs
/// <summary>
/// Gets a property's value as a specified type.
/// </summary>
/// <param name="propertyInfo">
/// PropertyInfo object containing property metadata.</param>
Gets a property's value as a specified type.
Gets a property ' s value as a specified type .
protected virtual object ReadProperty(IPropertyInfo propertyInfo)
    {
      if ((propertyInfo.RelationshipType & RelationshipTypes.PrivateField) == RelationshipTypes.PrivateField)
      {
        return MethodCaller.CallPropertyGetter(this, propertyInfo.Name);
      }
      object result = null;
      var info = FieldManager.GetFieldData(propertyInfo);
      if (info != null)
      {
        result = info.Value;
      }
      else
      {
        result = propertyInfo.DefaultValue;
        FieldManager.LoadFieldData(propertyInfo, result);
      }
      return result;
    }
protected virtual object ReadProperty ( IPropertyInfo propertyInfo ) { if ( ( propertyInfo . RelationshipType & RelationshipTypes . PrivateField ) == RelationshipTypes . PrivateField ) { return MethodCaller . CallPropertyGetter ( this , propertyInfo . Name ) ; } object result = null ; var info = FieldManager . GetFieldData ( propertyInfo ) ; if ( info != null ) { result = info . Value ; } else { result = propertyInfo . DefaultValue ; FieldManager . LoadFieldData ( propertyInfo , result ) ; } return result ; }
Gets a property's value as a specified type.
Gets a property ' s value as a specified type .
propertyInfo
IPropertyInfo
PropertyInfo object containing property metadata.
PropertyInfo object containing property metadata .