public string[] Report()
        {
            var report = new List <string>();

            foreach (var stat in BulkInsertStatistics)
            {
                report.Add($"{stat.Item1.Name} - AffectedRows = {AffectedRows.Single(r => r.Item1 == stat.Item1).Item2}, BulkCopy={stat.Item2.TimeElapsedDuringBulkCopy.TotalSeconds}, InsertInto={stat.Item2.TimeElapsedDuringInsertInto.TotalSeconds}");
            }

            return(report.ToArray());
        }
Beispiel #2
0
 void System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteAttributeString("ActionId", ActionId.ToString());
     writer.WriteAttributeString("Success", Success.ToString());
     writer.WriteAttributeString("AffectedRows", AffectedRows.ToString());
     writer.WriteAttributeString("RowVersion", RowVersion.ToString());
     writer.WriteStartElement("FailureMessage");
     if (!string.IsNullOrEmpty(FailureMessage))
     {
         writer.WriteValue(FailureMessage);
     }
     writer.WriteEndElement();
     writer.WriteStartElement("Result");
     if (Result != null)
     {
         writer.WriteValue(Result);
     }
     writer.WriteEndElement();
     writer.WriteStartElement("Parameters", Namespaces.Data);
     if (Parameters != null)
     {
         foreach (System.Xml.Serialization.IXmlSerializable parameter in Parameters)
         {
             writer.WriteStartElement("Parameter", Namespaces.Data);
             if (parameter != null)
             {
                 parameter.WriteXml(writer);
             }
             writer.WriteEndElement();
         }
     }
     writer.WriteEndElement();
     writer.WriteStartElement("AlternativeActions", Namespaces.Data);
     foreach (System.Xml.Serialization.IXmlSerializable parameter in AlternativeActions)
     {
         writer.WriteStartElement("PersistenceActionResult", Namespaces.Data);
         if (parameter != null)
         {
             parameter.WriteXml(writer);
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
     writer.WriteStartElement("BeforeActions", Namespaces.Data);
     foreach (System.Xml.Serialization.IXmlSerializable parameter in BeforeActions)
     {
         writer.WriteStartElement("PersistenceActionResult", Namespaces.Data);
         if (parameter != null)
         {
             parameter.WriteXml(writer);
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
     writer.WriteStartElement("AfterActions", Namespaces.Data);
     foreach (System.Xml.Serialization.IXmlSerializable parameter in AfterActions)
     {
         writer.WriteStartElement("PersistenceActionResult", Namespaces.Data);
         if (parameter != null)
         {
             parameter.WriteXml(writer);
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }