Source/Csla/Core/ManagedObjectBase.cs
/// <summary>
/// Gets a property's value as a specified type.
/// </summary>
/// <typeparam name="P">
/// Type of the property.
/// </typeparam>
/// <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 P ReadProperty<P>(PropertyInfo<P> propertyInfo)
    {
      P result = default(P);
      FieldManager.IFieldData data = FieldManager.GetFieldData(propertyInfo);
      if (data != null)
      {
        var fd = data as FieldManager.IFieldData<P>;
        if (fd != null)
          result = fd.Value;
        else
          result = (P)data.Value;
      }
      else
      {
        result = propertyInfo.DefaultValue;
        FieldManager.LoadFieldData<P>(propertyInfo, result);
      }
      return result;
    }
protected P ReadProperty < P > ( PropertyInfo < P > propertyInfo ) { P result = default ( P ) ; FieldManager . IFieldData data = FieldManager . GetFieldData ( propertyInfo ) ; if ( data != null ) { var fd = data as FieldManager . IFieldData < P > ; if ( fd != null ) result = fd . Value ; else result = ( P ) data . Value ; } else { result = propertyInfo . DefaultValue ; FieldManager . LoadFieldData < P > ( propertyInfo , result ) ; } return result ; }
Gets a property's value as a specified type.
Gets a property ' s value as a specified type .
propertyInfo
PropertyInfo<P>
PropertyInfo object containing property metadata.
PropertyInfo object containing property metadata .
typeparam
Type of the property.
Type of the property .