static void Main(string[] args) { var logger = new AppLoggerDefault(); var url = "http://booking.trcont.ru/RisApi/"; var client = new WebClient(logger, url) { ConnectionLeaseTimeout = 0, //ConnectionsLimit = 10, MaxIdleTime = 120000 }; Console.WriteLine($"Количество одновременных соединений {client.ConnectionsLimit}"); client.ConnectionsLimit = 10; var tasks = new List <Task>(); for (int i = 0; i < 10; i++) { tasks.Add(client.PostAsync <dynamic>("Info/GetOrderInfoById", new { Id = 60081373 })); } Task.WaitAll(tasks.ToArray()); var results = tasks.Select(x => ((Task <dynamic>)x).Result).ToArray(); Console.ReadKey(); }
public FactoryTestService() { Logger = new AppLoggerDefault(); Dialect = new SqlDialectDapper(); Dialect.Init(SqlDialectEnum.Sqlite); ConnectionFactory = new ConnectionFactorySqlite(Logger, ConnectionString, Dialect); }
public void Debug() { var logger = new AppLoggerDefault(); logger.Debug("hi"); }
public void FatalException() { var logger = new AppLoggerDefault(); logger.Fatal(new Exception()); }
public void FatalAggregateException() { var logger = new AppLoggerDefault(); logger.Fatal(new AggregateException()); }
public void ErrorAggregateException() { var logger = new AppLoggerDefault(); logger.Error(new AggregateException()); }
public void ErrorException() { var logger = new AppLoggerDefault(); logger.Error(new Exception()); }
public void Error() { var logger = new AppLoggerDefault(); logger.Error("hi"); }
public void Warning() { var logger = new AppLoggerDefault(); logger.Warning("hi"); }
public void Info() { var logger = new AppLoggerDefault(); logger.Info("hi"); }