protected internal virtual byte[] ReadSerializedValueFromFields(IValueFields valueFields) { if (valueFields.ByteArrayValue == null && !string.IsNullOrEmpty(valueFields.ByteArrayId)) { if (context.Impl.Context.CommandContext != null) { var bytearr = context.Impl.Context.CommandContext.ByteArrayManager.Get(valueFields.ByteArrayId); valueFields.ByteArrayValue = bytearr.Bytes; } else { using (IScope scope = ObjectContainer.BeginLifetimeScope()) { IByteArrayManager manager = scope.Resolve <IByteArrayManager>(); var bytearr = manager.Get(valueFields.ByteArrayId); valueFields.ByteArrayValue = bytearr.Bytes; } } } return(valueFields.ByteArrayValue); }