Test

Test

Old forum URL: forums.lhotka.net/forums/t/8176.aspx


rxelizondo posted on Wednesday, December 16, 2009

protected P ReadProperty<P>(PropertyInfo<P> propertyInfo)
{
if (((propertyInfo.RelationshipType & RelationshipTypes.LazyLoad) != 0) && !FieldManager.FieldExists(propertyInfo))
throw new InvalidOperationException(Resources.PropertyGetNotAllowed);

P result;
var info = (FieldManager.FieldData<P>)FieldManager.GetFieldData(propertyInfo);
if (info != null)
{
result = info.Value;
}
else
{
result = propertyInfo.DefaultValue;
FieldManager.LoadFieldData<P>(propertyInfo, result);
}

return result;
}

Copyright (c) Marimer LLC