public ModelsCreate(LogInfo logInfo, Writer <LogInfo> writerLogInfo, Writer <IpAddressCompany> writerIpAddress, IpAddressCompany ipAddressCompany, InfoAboutFile infoAboutFile) { this.infoAboutFile = infoAboutFile; this.ipAddressCompany = ipAddressCompany; this.logInfo = logInfo; this.writerLogInfo = writerLogInfo; this.writerIpAddress = writerIpAddress; }
private InfoAboutFile ModelInfoAboutFileFill(TempInfoFiles item, string title) { InfoAboutFile infoAboutFile = new InfoAboutFile() { PathName = item.PathName, Size = item.Size, Title = title }; return(infoAboutFile); }
static void Main(string[] args) { const string pathToLogFile = @"../../LogIsHere/tariscope.access.log"; List <string> ipList = new List <string>(); List <string> fileNameList = new List <string>(); LogInfo logInfo = new LogInfo(); IpAddressCompany ipAddressCompany = new IpAddressCompany(); InfoAboutFile infoAboutFile = new InfoAboutFile(); Writer <LogInfo> writerLogInfo = new Writer <LogInfo>(new LogFileContext()); Writer <IpAddressCompany> writerIpAddress = new Writer <IpAddressCompany>(new LogFileContext()); ModelsCreate <LogInfo> create = new ModelsCreate <LogInfo>(logInfo, writerLogInfo, writerIpAddress, ipAddressCompany, infoAboutFile); create.CreatModel(pathToLogFile); }
private async Task RunTasksAsync(InfoAboutFile infoAboutFile) { List <TempInfoFiles> list; using (LogFileContext context = new LogFileContext()) { list = context.logInfo.Select(x => new TempInfoFiles { PathName = x.Path, Size = x.Size }).ToList(); } int countTread = 2; Task task0 = GetTitleAsync(list, 0, 1 * list.Count / countTread); Task task1 = GetTitleAsync(list, 1 * list.Count / countTread, 2 * list.Count / countTread); await Task.WhenAll(task0, task1); }