Пример #1
0
        public object GetValue(IDataReader dataReader, int columnIndex, Type targetType)
        {
            var xmlStr = dataReader.GetString(columnIndex);

            if (String.IsNullOrEmpty(xmlStr))
            {
                return(null);
            }
            return(XmlSerializeUtil.Deserialize(xmlStr, targetType));
        }
Пример #2
0
        public object GetValue(IDataReader dataReader, int columnIndex, Type targetType)
        {
            if (dataReader.IsDBNull(columnIndex))
            {
                return(null);
            }
            var xmlStr = dataReader.GetString(columnIndex);

            return(XmlSerializeUtil.Deserialize(xmlStr, targetType));
        }
Пример #3
0
 public object GetSetParameterValue(object parameterValue)
 {
     if (parameterValue == null)
     {
         return(DBNull.Value);
     }
     else
     {
         return(XmlSerializeUtil.Serializer(parameterValue));
     }
 }
Пример #4
0
 public void SetParameter(IDataParameter dataParameter, object parameterValue)
 {
     if (parameterValue == null)
     {
         dataParameter.Value = DBNull.Value;
     }
     else
     {
         var xmlStr = XmlSerializeUtil.Serializer(parameterValue);
         dataParameter.Value = xmlStr;
     }
 }
Пример #5
0
 public virtual object ToParameterValue(object value)
 {
     return(XmlSerializeUtil.Serializer(value));
 }
Пример #6
0
 protected override object GetSetParameterValueWhenNotNull(object parameterValue)
 {
     return(XmlSerializeUtil.Serializer(parameterValue));
 }