Example #1
0
 /// <summary>
 /// Execute the operation synchronously.
 /// </summary>
 /// <returns></returns>
 public override int Execute(object state)
 {
     return(Prepare().Execute(cmd =>
     {
         using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
         {
             return m_CsvSerializer.Serialize(reader, m_OutputStream, m_IncludeHeaders);
         }
     }, state).Value);
 }
        /// <summary>
        /// Execute the operation synchronously.
        /// </summary>
        /// <returns></returns>
        public override string Execute(object state)
        {
            var result = new StringWriter();

            Prepare().Execute(cmd =>
            {
                using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
                {
                    return(m_CsvSerializer.Serialize(reader, result, m_IncludeHeaders));
                }
            }, state);

            return(result.ToString());
        }