DD.WellWorkover.Cloud/ConsoleApp1/Program.cs

31 lines
991 B
C#

using AsbCloudApp.Requests;
using AsbCloudDb.Model;
using AsbCloudInfrastructure;
using AsbCloudInfrastructure.Repository;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Threading;
namespace ConsoleApp1
{
class Program
{
private static AsbCloudDbContext db = ServiceFactory.Context;
// use ServiceFactory to make services
static void Main(/*string[] args*/)
{
DependencyInjection.MapsterSetup();
var sw = System.Diagnostics.Stopwatch.StartNew();
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;
sw.Stop();
Console.WriteLine($"total time: {sw.ElapsedMilliseconds} ms");
Console.ReadLine();
}
}
}