Ejemplo n.º 1
0
 public void SetValue(object userObject, object value) // if record , unwrapp to object, use materializer in cacheentry
 {
     Debug.Assert(null != _clrProperty, "shadowstate not supported");
     if (DBNull.Value == value)
     {
         value = null;
     }
     if (IsComplex && value == null)
     {
         throw EntityUtil.NullableComplexTypesNotSupported(CLayerName);
     }
     LightweightCodeGenerator.SetValue(_clrProperty, userObject, value);
 }
 public override void SetValue(object item, object value)
 {
     EntityUtil.CheckArgumentNull(item, "item");
     if (!_itemType.IsAssignableFrom(item.GetType()))
     {
         throw EntityUtil.IncompatibleArgument();
     }
     if (!_isReadOnly)
     {
         LightweightCodeGenerator.SetValue(_property, item, value);
     } // if not entity it must be readonly
     else
     {
         throw EntityUtil.WriteOperationNotAllowedOnReadOnlyBindingList();
     }
 }