2023-02-16 16:27:14 +05:00
|
|
|
|
using System;
|
2022-10-11 09:02:53 +05:00
|
|
|
|
using System.Collections.Generic;
|
2022-06-17 13:20:48 +05:00
|
|
|
|
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;
|
2023-01-13 17:28:04 +05:00
|
|
|
|
using CliWrap;
|
2023-02-16 16:27:14 +05:00
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2021-10-26 17:22:32 +05:00
|
|
|
|
|
|
|
|
|
namespace ConsoleApp1
|
2021-04-02 17:28:07 +05:00
|
|
|
|
{
|
|
|
|
|
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-01-13 17:28:04 +05:00
|
|
|
|
});
|
2023-02-16 16:27:14 +05:00
|
|
|
|
var d = q.AsNoTracking().ToArray();
|
|
|
|
|
}
|
2022-06-17 13:20:48 +05:00
|
|
|
|
}
|
2021-04-02 17:28:07 +05:00
|
|
|
|
}
|