2021-10-08 11:30:57 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
using AsbCloudInfrastructure.Services;
|
|
|
|
|
using AsbCloudInfrastructure.Services.Cache;
|
2021-10-09 20:16:22 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services.WellOperationService;
|
2021-10-08 11:30:57 +05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ConsoleApp1
|
|
|
|
|
{
|
|
|
|
|
public static class DebugWellOperationImportService
|
|
|
|
|
{
|
2021-10-08 17:00:30 +05:00
|
|
|
|
private static DbContextOptions<AsbCloudDbContext> options = new DbContextOptionsBuilder<AsbCloudDbContext>()
|
|
|
|
|
.UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True")
|
|
|
|
|
.Options;
|
|
|
|
|
|
2021-10-08 11:30:57 +05:00
|
|
|
|
public static void Main(/*string[] args*/)
|
|
|
|
|
{
|
|
|
|
|
using var db = new AsbCloudDbContext(options);
|
|
|
|
|
|
2021-10-08 17:00:30 +05:00
|
|
|
|
var wellOperationImportService = new WellOperationImportService(db);
|
2021-10-08 11:30:57 +05:00
|
|
|
|
|
2021-10-09 20:16:22 +05:00
|
|
|
|
//var inStream = System.IO.File.OpenRead(@"C:\temp\Миграция.xlsx");
|
|
|
|
|
//wellOperationImportService.Import(1, inStream);
|
|
|
|
|
var stream = wellOperationImportService.Export(1);
|
|
|
|
|
var fs = System.IO.File.Create(@"C:\temp\2.xlsx");
|
|
|
|
|
stream.CopyTo(fs);
|
|
|
|
|
fs.Flush();
|
|
|
|
|
fs.Close();
|
|
|
|
|
fs.Dispose();
|
2021-10-08 11:30:57 +05:00
|
|
|
|
Console.WriteLine("_");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|