DBDownloader
Quick implementation
//Generate a connection string with custom properties set
string _CNS() => new SqlConnectionStringBuilder(c.GetConnectionString("main")) { Pooling = true, MaxPoolSize = 200, MultipleActiveResultSets = false, PacketSize = 32767 }.ToString();
//Create an instance of our data class with proeprties to hold results
var DataObject = new CircuitData();
//Allocate and assign with downloader extension.
var dl = Downloader.DBDownloader(DataObject, () => new SqlConnection(_CNS()))
.Assign(f => f.circuits, "SELECT ID,Type,Name from dbo.Circuit", ConnectionPreExecute: "SET ARITHABORT ON")
.Assign(f => f.circuitTypes, "SELECT * from util.CircuitType", ConnectionPreExecute: "SET ARITHABORT ON")
//Wait can be called inline, or later!
// You can proceed to do other operations until data is needed
.Wait();
Console.WriteLine($"DL time: {dl.GetDownloadTime().TotalMilliseconds:F0}");Downloader Extension
Assign / AssignSingle
Example:
Wait
Example:
GetDownloadTime
Example:
Downloads
Last updated

