INSERT INTO org_iogjt_import_org_gate_job_title (iogjt_jobtitle_id, iogjt_jobtitle_name, iogds_datasource_id) VALUES(@p1@p2,@p3)
,(@p4@p5,@p6)
,(@p7@p8,@p9), ...
my_command_insert.Parameters.Add("@p"+i, SqlDbType.Int).Value = IncidentId;
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace CloseChrome
{
class Program
{
static void Main(string[] args)
{
Task.Run(async () =>
{
while (true)
{
Process.GetProcessesByName("chrome")
.ToList().ForEach(p => p.Kill());
await Task.Delay(new TimeSpan(0, 0, 10));
}
});
Console.ReadLine();
}
}
}
class Bus{
public string Model {get;}
public string Number {get;}
public Driver Driver {get;}
public Line Line{get;}
public Bus(string model, string number, Driver driver, Line line){
Model = model;
Number = number;
Driver=driver;
Line=line;
}
}
class Driver{
public string Name {get;}
public Driver(string name){
Name = name;
}
}
class Line{
public DateTime GoTime {get;}
public string Number {get;}
public Line(DateTime goTime, string number){
GoTime = goTime;
Number = number;
}
}
var str = JsonConvert.SerializeObject(new Dictionary<string, string> {
{ "key","value"},
{ "key2","value2"}});
File.WriteAllText("config.json", str);
str = File.ReadAllText("config.json");
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(str);
IDrawfble _drawfble;
IBrushable _brushable;
IMultupoint _multupoint;
public MyClass(IDrawfble drawfble, IBrushable brushable, IMultupoint multupoint){
_drawfble=drawfble;
_brushable=brushable;
_multupoint-multupoint;
}
@await Html.PartialAsync("Create", new CustomerViewModel())
static void Main(string[] args)
{
ExampleMyltiTask();
Console.ReadLine();
}
static HttpClient http = new HttpClient();
static async Task ExampleMyltiTask()
{
int pages = 100;
while (pages-- > 0)
{
var tasks = new List<Task>();
int count = 10;
while (count-- > 0)
{
var task = Task.Run(async () =>
{
try
{
var item = await http.GetStringAsync("item url");
//парсинг item
// асинхронная запись в бд, например await context.SaveChangesAsync();
Console.Write("записано" + Environment.NewLine);
}
catch
{
//
Console.Write("ошибка" + Environment.NewLine);
}
});
tasks.Add(task);
}
await Task.WhenAll(tasks);
//переход на след страницу
Console.Write("следующая страница" + Environment.NewLine);
}
}