Exemplo n.º 1
0
        public void DeserializeMultiSets(SetCollection sets, bool dateTimeAsUtc = false)
        {
            if (sets == null || sets.Count == 0)
            {
                throw new ArgumentNullException("sets", "Empty collection of sets");
            }

            int index = 0;

            using (this.OpenConnection())
            {
                SqlDataReader sqlDataReader = this._command.ExecuteReader();
                do
                {
                    Type  setType = sets.GetSetType(index);
                    IList list    = sets[index];
                    if (setType == typeof(ExpandoObject))
                    {
                        while (sqlDataReader.Read())
                        {
                            list.Add((dynamic)Deserialize <ExpandoObject, object>(sqlDataReader, dateTimeAsUtc));
                        }
                    }
                    else
                    {
                        while (sqlDataReader.Read())
                        {
                            list.Add(Deserialize((IDataRecord)sqlDataReader, setType, dateTimeAsUtc));
                        }
                    }
                    ++index;
                }while (sets.Count > index && sqlDataReader.NextResult());
                sqlDataReader.Close();
            }
        }
Exemplo n.º 2
0
        public void DeserializeMultiSets(SetCollection sets, string commandText, Parameter parameter = null, bool dateTimeAsUtc = false, bool storedProcedure = false)
        {
            SqlSerializer sqlSerializer = this;
            SetCollection sets1         = sets;
            string        commandText1  = commandText;

            Parameter[] parameters;
            if (parameter == null)
            {
                parameters = (Parameter[])null;
            }
            else
            {
                parameters = new Parameter[1]
                {
                    parameter
                }
            };
            int num1 = dateTimeAsUtc ? 1 : 0;
            int num2 = storedProcedure ? 1 : 0;

            sqlSerializer.DeserializeMultiSets(sets1, commandText1, parameters, num1 != 0, num2 != 0);
        }
Exemplo n.º 3
0
 public void DeserializeMultiSets(SetCollection sets, string commandText, Parameter[] parameters, bool dateTimeAsUtc = false, bool storedProcedure = false)
 {
     this.SetupCommand(commandText, parameters, storedProcedure, commandTimeoutInSecs);
     this.DeserializeMultiSets(sets, dateTimeAsUtc);
 }
Exemplo n.º 4
0
 public void DeserializeMultiSets(SetCollection sets, string commandText, bool dateTimeAsUtc, params Parameter[] parameters)
 {
     this.SetupCommand(commandText, parameters, false, commandTimeoutInSecs);
     this.DeserializeMultiSets(sets, dateTimeAsUtc);
 }