DD.WellWorkover.Cloud/AsbCloudDb/Model/IAsbCloudDbContext.cs

48 lines
2.2 KiB
C#

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudDb.Model
{
public interface IAsbCloudDbContext
{
DbSet<Cluster> Clusters { get; set; }
DbSet<Company> Companies { get; set; }
DbSet<DataSaubBase> DataSaubBases { get; set; }
DbSet<Deposit> Deposits { get; set; }
DbSet<TelemetryEvent> TelemetryEvents { get; set; }
DbSet<TelemetryMessage> TelemetryMessages { get; set; }
DbSet<User> Users { get; set; }
DbSet<UserRole> UserRoles { get; set; }
DbSet<ReportProperties> ReportProperties { get; set; }
DbSet<File> Files { get; set; }
DbSet<FileCategory> FileCategories { get; set; }
DbSet<Telemetry> Telemetries { get; set; }
DbSet<TelemetryUser> TelemetryUsers { get; set; }
DbSet<TelemetryOperation> TelemetryOperations { get; set; }
DbSet<TelemetryAnalysis> TelemetryAnalysis { get; set; }
DbSet<Well> Wells { get; set; }
DbSet<WellSection> WellSections { get; set; }
DbSet<WellOperation> WellOperations { get; set; }
DbSet<WellType> WellTypes { get; set; }
DbSet<LastData> LastData { get; set; }
int SaveChanges();
int SaveChanges(bool acceptAllChangesOnSuccess);
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
DbSet<TEntity> Set<TEntity>(string name) where TEntity : class;
DbSet<TEntity> Set<TEntity>() where TEntity : class;
IQueryable<Well> GetWellsForCompany(int idCompany);
IQueryable<User> GetUsersByLogin(string login);
Task<(DateTime From, DateTime To)> GetDatesRangeAsync<T>(int idTelemetry, CancellationToken token) where T : class, IIdTelemetryDate;
Task<IEnumerable<(double? MinDepth, double? MaxDepth, DateTime BeginPeriodDate)>> GetDepthToIntervalAsync(int telemetryId,
int intervalHoursTimestamp, int workStartTimestamp, double timezoneOffset, CancellationToken token);
Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default) where TEntity : class;
}
}