diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index 747c5d04..d01c0556 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -16,8 +16,6 @@ namespace AsbCloudDb.Model public virtual DbSet Companies { get; set; } public virtual DbSet DataSaubBases { get; set; } public virtual DbSet Deposits { get; set; } - public virtual DbSet Events { get; set; } - public virtual DbSet Messages { get; set; } public virtual DbSet Users { get; set; } public virtual DbSet UserRoles { get; set; } public virtual DbSet Wells { get; set; } @@ -25,8 +23,10 @@ namespace AsbCloudDb.Model public virtual DbSet Files { get; set; } public virtual DbSet FileCategories { get; set; } public virtual DbSet Telemetries { get; set; } + public virtual DbSet TelemetryEvents { get; set; } + public virtual DbSet TelemetryMessages { get; set; } public virtual DbSet TelemetryUsers { get; set; } - public virtual DbSet Operations { get; set; } + public virtual DbSet TelemetryOperations { get; set; } public virtual DbSet TelemetryAnalysis { get; set; } public virtual DbSet WellSections { get; set; } public virtual DbSet WellOperations { get; set; } @@ -74,7 +74,7 @@ namespace AsbCloudDb.Model .HasConstraintName("t_data_saub_base_t_telemetry_id_fk"); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasOne(d => d.Telemetry) .WithMany(p => p.Messages) @@ -106,9 +106,9 @@ namespace AsbCloudDb.Model .HasConstraintName("t_analysis_t_operation_id_fk"); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { - entity.HasKey(nameof(Event.IdTelemetry), nameof(Event.IdEvent)); + entity.HasKey(nameof(TelemetryEvent.IdTelemetry), nameof(TelemetryEvent.IdEvent)); entity.HasOne(d => d.Telemetry) .WithMany(p => p.Events) .HasForeignKey(d => d.IdTelemetry) diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index b61f505e..c9c0c966 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -13,8 +13,8 @@ namespace AsbCloudDb.Model DbSet Companies { get; set; } DbSet DataSaubBases { get; set; } DbSet Deposits { get; set; } - DbSet Events { get; set; } - DbSet Messages { get; set; } + DbSet TelemetryEvents { get; set; } + DbSet TelemetryMessages { get; set; } DbSet Users { get; set; } DbSet UserRoles { get; set; } DbSet ReportProperties { get; set; } @@ -22,7 +22,7 @@ namespace AsbCloudDb.Model DbSet FileCategories { get; set; } DbSet Telemetries { get; set; } DbSet TelemetryUsers { get; set; } - DbSet Operations { get; set; } + DbSet TelemetryOperations { get; set; } DbSet TelemetryAnalysis { get; set; } DbSet Wells { get; set; } DbSet WellSections { get; set; } diff --git a/AsbCloudDb/Model/Telemetry.cs b/AsbCloudDb/Model/Telemetry.cs index 59759f56..935f2d7f 100644 --- a/AsbCloudDb/Model/Telemetry.cs +++ b/AsbCloudDb/Model/Telemetry.cs @@ -15,7 +15,7 @@ namespace AsbCloudDb.Model public Telemetry() { DataSaubBases = new HashSet(); - Messages = new HashSet(); + Messages = new HashSet(); } [Key] @@ -34,14 +34,14 @@ namespace AsbCloudDb.Model [InverseProperty(nameof(DataSaubBase.Telemetry))] public virtual ICollection DataSaubBases { get; set; } - [InverseProperty(nameof(Message.Telemetry))] - public virtual ICollection Messages { get; set; } + [InverseProperty(nameof(TelemetryMessage.Telemetry))] + public virtual ICollection Messages { get; set; } [InverseProperty(nameof(TelemetryUser.Telemetry))] public virtual ICollection Users { get; set; } - [InverseProperty(nameof(Event.Telemetry))] - public virtual ICollection Events { get; set; } + [InverseProperty(nameof(TelemetryEvent.Telemetry))] + public virtual ICollection Events { get; set; } [InverseProperty(nameof(TelemetryAnalysis.Telemetry))] public virtual ICollection Analysis { get; set; } diff --git a/AsbCloudDb/Model/Event.cs b/AsbCloudDb/Model/TelemetryEvent.cs similarity index 72% rename from AsbCloudDb/Model/Event.cs rename to AsbCloudDb/Model/TelemetryEvent.cs index 8f708aec..1debf080 100644 --- a/AsbCloudDb/Model/Event.cs +++ b/AsbCloudDb/Model/TelemetryEvent.cs @@ -6,8 +6,8 @@ using System.Text.Json.Serialization; namespace AsbCloudDb.Model { - [Table("t_event"), Comment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии.")] - public partial class Event + [Table("t_telemetry_event"), Comment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии.")] + public partial class TelemetryEvent { [Column("id_event")] public int IdEvent { get; set; } @@ -26,7 +26,7 @@ namespace AsbCloudDb.Model [Column("message_template")] public string MessageTemplate { get; set; } - public string MakeMessageText(Message message) + public string MakeMessageText(TelemetryMessage message) { var args = new string[] { message.Arg0, message.Arg1, message.Arg2, message.Arg3 }; return string.Format(MessageTemplate, args); diff --git a/AsbCloudDb/Model/Message.cs b/AsbCloudDb/Model/TelemetryMessage.cs similarity index 90% rename from AsbCloudDb/Model/Message.cs rename to AsbCloudDb/Model/TelemetryMessage.cs index 07a635fd..431159c3 100644 --- a/AsbCloudDb/Model/Message.cs +++ b/AsbCloudDb/Model/TelemetryMessage.cs @@ -7,8 +7,8 @@ using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudDb.Model { - [Table("t_message"), Comment("Сообщения на буровых")] - public partial class Message : IId, IIdTelemetryDate + [Table("t_telemetry_message"), Comment("Сообщения на буровых")] + public partial class TelemetryMessage : IId, IIdTelemetryDate { [Key] [Column("id")]