From a49c9ec8765cbc592a5e2b4cdee853fb9d865936 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 13 Apr 2022 09:27:10 +0200 Subject: [PATCH] =?UTF-8?q?fix=20de=20l'update=20des=20entit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/launchSettings.json | 2 +- .../espacecollab.backend.api/Startup.cs | 2 +- .../espacecollab.backend.api/appsettings.json | 5 +++-- .../Repository/GenericSqlRepository.cs | 1 + .../db/init_db.sql - Raccourci.lnk | Bin 0 -> 1102 bytes 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/init_db.sql - Raccourci.lnk diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json b/Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json index 8505599..c08dccf 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json @@ -16,7 +16,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:8081;http://localhost:8080", + "applicationUrl": "https://localhost:5001;http://localhost:5000", "dotnetRunMessages": true }, "IIS Express": { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs index 7e053de..9561ab5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs @@ -38,7 +38,7 @@ public class Startup app.UseDeveloperExceptionPage(); } app.UseCors( - options => options.WithOrigins("http://localhost:4200", "http://localhost:8082", "http://localhost:8083").AllowAnyMethod().AllowAnyHeader() + options => options.WithOrigins("http://localhost:4200", "http://localhost:8082", "http://localhost:8083", "http://localhost:5000", "http://localhost:5001").AllowAnyMethod().AllowAnyHeader() ); app.UseSwagger(); app.UseSwaggerUI(); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json index ed4dac8..64f8b67 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json @@ -8,7 +8,8 @@ "AllowedHosts": "*", "Sql": { "LoadFake": false, - //"ConnectionString": "server=db;user=root;password=root;database=collaborateur_epa" - "ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa" + "ConnectionString": "server=database;user=root;password=root;database=collaborateur_epa" //préprod + //"ConnectionString": "server=db;user=root;password=root;database=collaborateur_epa" //docker-compose + //"ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa" //local } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs index 532ea08..abb0343 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs @@ -43,6 +43,7 @@ public class GenericSqlRepository : IGenericRepository where T : class, IG public virtual T? Update(T entity) { + Context.ChangeTracker.Clear(); Context.Set().Update(entity); Context.SaveChanges(); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/init_db.sql - Raccourci.lnk b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/init_db.sql - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..411b0c65ca031db5eb4e1337051f11aecb7d4b50 GIT binary patch literal 1102 zcma)4T}TvB6#mxMP$XDOBtvVlmrB}P!xk5X+8>*irCoBOf~jrS*=lWeW}KZVGZ6)q zs08sBk)-G$dhl`I5_+@f_bDRk+}R%&YiZBr{M>ubJ>U7cK>(JTGLpax zQ=)SU6|j@tINJPV!j-m!FD~4Bb}Vgam<{Z7b)+q4Dl?9jjLOUXWi{9pUJb3-*W3x) z{d5JInw#&`;egjIAd%F`V>?+nj7Hf8Zzvc%;u&lK_&mmIPY$DesFvPr z+JMp8b^%_BC(()`MwUieCp?3!2>eiK&#*?aSi`)py%0;vVj298WDaZh@-}*7-GKGG z>23*F5z{A0xC&JqryP7_b(=YG`FaQXZ4hI?p)9(_@9i7o2SnCQW#M1wH&>rRqzZwp zBwN77Z14m9b|mD49uZ@XRIdas8&Bq!PqJGUuc~viiB6(`-dD^c0hw5*99d)s<=abr z1a=UQ5!Vy5Z^U#fF{4r9I$|~nYt<{*NS{i`qH;B52Yscmru4-1lt(cnMHjq^Bt>J2 z7S-d17V)dmzfU4wC8;W@c*Li43t~(tEQkJ-145BJz0_$p-4_32LJ9LK#i!Uz1+#DG zGu@azO`1`+q^Y{2cwGBZzCO_tc)l{U=hobZ#rZeGlaFRTR*#<@+4rk@=KKHd z{S=3WJ>5py*%j`Zt4;c5$5rkjci8cuqwjVDonK;D9Pu@gTRHcxJ+OH6?awbuU#Hl4 Gj{X3&qw=`` literal 0 HcmV?d00001