DD.WellWorkover.Cloud/ConsoleApp1/Program.cs

31 lines
991 B
C#
Raw Normal View History

using AsbCloudApp.Requests;
2022-10-06 13:49:20 +05:00
using AsbCloudDb.Model;
2022-11-15 17:44:48 +05:00
using AsbCloudInfrastructure;
using AsbCloudInfrastructure.Repository;
using Microsoft.Extensions.Caching.Memory;
2022-05-05 10:06:15 +05:00
using System;
2022-10-06 13:49:20 +05:00
using System.Threading;
namespace ConsoleApp1
{
class Program
2021-10-03 20:08:17 +05:00
{
2022-10-06 13:49:20 +05:00
private static AsbCloudDbContext db = ServiceFactory.Context;
2022-11-15 17:44:48 +05:00
2022-10-06 13:49:20 +05:00
// use ServiceFactory to make services
static void Main(/*string[] args*/)
{
2022-11-15 17:44:48 +05:00
DependencyInjection.MapsterSetup();
var sw = System.Diagnostics.Stopwatch.StartNew();
2022-10-11 17:04:26 +05:00
var repo = new WellOperationRepository(db, new MemoryCache(new MemoryCacheOptions()), ServiceFactory.MakeWellService());
var req = new WellOperationRequest { IdWell = 88, OperationType = 1, Skip = 70};
var res = repo.GetPageAsync(req, CancellationToken.None).Result;
2022-10-11 17:04:26 +05:00
2022-11-15 17:44:48 +05:00
sw.Stop();
Console.WriteLine($"total time: {sw.ElapsedMilliseconds} ms");
Console.ReadLine();
2022-10-06 13:49:20 +05:00
}
}
}