DD.WellWorkover.Cloud/ConsoleApp1/Program.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2023-02-16 16:27:14 +05:00
using System;
using System.Collections.Generic;
using System.IO;
2022-10-06 13:49:20 +05:00
using System.Linq;
2023-02-16 16:27:14 +05:00
using System.Threading;
2022-10-06 13:49:20 +05:00
using System.Threading.Tasks;
2023-02-16 16:27:14 +05:00
using AsbCloudApp.Data;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure;
using CliWrap;
2023-02-16 16:27:14 +05:00
using Mapster;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace ConsoleApp1
{
class Program
2021-10-03 20:08:17 +05:00
{
2022-10-06 13:49:20 +05:00
static void Main(/*string[] args*/)
{
2023-02-16 16:27:14 +05:00
var db = ServiceFactory.Context;
var q = db.TelemetryDataSaub
.Select(t => new {
t.IdTelemetry,
t.DateTime,
t.WellDepth,
})
.GroupBy(t => t.IdTelemetry)
.Select(g => new {
Id = g.Key,
First = g.OrderBy(t => t.DateTime).FirstOrDefault(),
Last = g.OrderBy(t => t.DateTime).LastOrDefault(),
});
2023-02-16 16:27:14 +05:00
var d = q.AsNoTracking().ToArray();
}
}
}