public Package(Configuration.Connection connection) { connection = connection ?? new Configuration.Connection(); Connection = connection; }
public Configuration.Connection ToConnection() { var c = new Configuration.Connection { Arguments = this.Arguments, Command = this.Command, ConnectionString = this.ConnectionString, ContentType = this.ContentType, Core = this.Core, Cube = this.Cube, Database = this.Database, DateFormat = this.DateFormat, Delimiter = this.Delimiter, Delimiters = this.Delimiters.Select(d => d.ToDelimiter()).ToList(), Encoding = this.Encoding, ErrorMode = this.ErrorMode, File = this.File, Folder = this.Folder, Footer = this.Footer, Format = this.Format, Header = this.Header, Index = this.Index, LinePattern = this.LinePattern, ModelType = this.ModelType, Name = this.Name, OpenWith = this.OpenWith, Password = this.Password, Path = this.Path, Provider = this.Provider, Schema = this.Schema, SchemaFileName = this.SchemaFileName, SearchOption = this.SearchOption, SearchPattern = this.SearchPattern, Server = this.Server, Servers = this.Servers.Select(s => s.ToServer()).ToList(), Table = this.Table, Template = this.Template, TextQualifier = this.TextQualifier, Types = this.Types.Select(t => t.ToType()).ToList(), Url = this.Url, User = this.User, Version = this.Version, WebMethod = this.WebMethod, Scroll = this.Scroll, Service = this.Service }; bool.TryParse(this.Buffer, out bool buffer); c.Buffer = buffer; bool.TryParse(this.DropControl, out var dropControl); c.DropControl = dropControl; int.TryParse(this.End, out var end); c.End = end; int.TryParse(this.ErrorLimit, out var errorLimit); c.ErrorLimit = errorLimit; int.TryParse(this.MaxDegreeOfParallism, out int mdop); c.MaxDegreeOfParallelism = mdop; short.TryParse(this.MaxLength, out short maxLength); c.MaxLength = maxLength; short.TryParse(this.MinLength, out short minLength); c.MinLength = minLength; int.TryParse(this.Port, out int port); c.Port = port; short.TryParse(this.Replicas, out short replicas); c.Replicas = replicas; int.TryParse(this.RequestTimeout, out int requestTimeout); c.RequestTimeout = requestTimeout; short.TryParse(this.Sample, out short sample); c.Sample = sample; int.TryParse(this.Seed, out int seed); c.Seed = seed; short.TryParse(this.Shards, out short shards); c.Shards = shards; int.TryParse(this.Start, out int start); c.Start = start; bool.TryParse(this.Stream, out bool stream); c.Stream = stream; int.TryParse(this.Timeout, out int timeOut); c.Timeout = timeOut; bool.TryParse(this.UseSsl, out bool useSsl); c.UseSsl = useSsl; bool.TryParse(this.StartTls, out bool startTls); c.StartTls = startTls; bool.TryParse(this.Synchronous, out bool synchronous); c.Synchronous = synchronous; bool.TryParse(this.Mars, out bool mars); c.Mars = mars; bool.TryParse(this.Enclose, out bool enclose); c.Enclose = enclose; return(c); }