From 17127d39211aff85f48226fd8605cd050a8546af Mon Sep 17 00:00:00 2001 From: Leandro Hernan Rojas Date: Fri, 4 Apr 2025 20:06:04 -0300 Subject: [PATCH] Add Patch y Cambios en ECustomer --- Domain/Entities/ECustomer.cs | 2 +- Domain/Entities/ECustomerAddress.cs | 2 +- Models/Models/PhSCustomerAddress.cs | 4 ++-- Models/Models/PhSDocumentType.cs | 5 ++++- Models/Models/PhronCareOperationsHubContext.cs | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Domain/Entities/ECustomer.cs b/Domain/Entities/ECustomer.cs index 4082858..c98c093 100644 --- a/Domain/Entities/ECustomer.cs +++ b/Domain/Entities/ECustomer.cs @@ -28,7 +28,7 @@ namespace Domain.Entities public virtual EAccountType? Accounttypes { get; set; } - public virtual ICollection PhSCustomerAddress { get; set; } = new List(); + public virtual ICollection PhSCustomerAddresses { get; set; } = new List(); public virtual ICollection PhSCustomerDocuments { get; set; } = new List(); diff --git a/Domain/Entities/ECustomerAddress.cs b/Domain/Entities/ECustomerAddress.cs index 830d281..5c4743b 100644 --- a/Domain/Entities/ECustomerAddress.cs +++ b/Domain/Entities/ECustomerAddress.cs @@ -10,7 +10,7 @@ namespace Domain.Entities { public int Id { get; set; } - public int? CustomersId { get; set; } + public int CustomersId { get; set; } public string? BusinessName { get; set; } diff --git a/Models/Models/PhSCustomerAddress.cs b/Models/Models/PhSCustomerAddress.cs index 0cd815e..e56fd11 100644 --- a/Models/Models/PhSCustomerAddress.cs +++ b/Models/Models/PhSCustomerAddress.cs @@ -7,7 +7,7 @@ public partial class PhSCustomerAddress { public int Id { get; set; } - public int? CustomersId { get; set; } + public int CustomersId { get; set; } public string? BusinessName { get; set; } @@ -33,5 +33,5 @@ public partial class PhSCustomerAddress public string? Notes { get; set; } - public virtual PhSCustomer? Customers { get; set; } + public virtual PhSCustomer Customers { get; set; } = null!; } diff --git a/Models/Models/PhSDocumentType.cs b/Models/Models/PhSDocumentType.cs index ae03306..511ea3f 100644 --- a/Models/Models/PhSDocumentType.cs +++ b/Models/Models/PhSDocumentType.cs @@ -1,4 +1,7 @@ -namespace Models.Models; +using System; +using System.Collections.Generic; + +namespace Models.Models; public partial class PhSDocumentType { diff --git a/Models/Models/PhronCareOperationsHubContext.cs b/Models/Models/PhronCareOperationsHubContext.cs index 8f84b75..0db422a 100644 --- a/Models/Models/PhronCareOperationsHubContext.cs +++ b/Models/Models/PhronCareOperationsHubContext.cs @@ -46,7 +46,7 @@ public partial class PhronCareOperationsHubContext : DbContext } } #endregion - // => optionsBuilder.UseSqlServer("data source=srv01.saludlab.com.ar,39458;initial catalog=phronCare_OperationsHub;User ID=sa;Password=HS|s[~xxQzTo/n>9jO;encrypt=False;trustServerCertificate=True;MultipleActiveResultSets=True"); + //=> optionsBuilder.UseSqlServer("data source=srv01.saludlab.com.ar,39458;initial catalog=phronCare_OperationsHub;User ID=sa;Password=HS|s[~xxQzTo/n>9jO;encrypt=False;trustServerCertificate=True;MultipleActiveResultSets=True"); protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -207,6 +207,7 @@ public partial class PhronCareOperationsHubContext : DbContext entity.HasOne(d => d.Customers).WithMany(p => p.PhSCustomerAddresses) .HasForeignKey(d => d.CustomersId) + .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_PhS_CustomerAddress_PhS_Customers"); });