Merge pull request 'fix de l'update des entités' (#10) from fix_update into develop

Reviewed-on: Clement.Ferrere/Collaborateur_Epa_Back#10
pull/11/head
Clement.Ferrere 3 years ago
commit 75d62373ac
  1. 2
      Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json
  2. 2
      Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs
  3. 5
      Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json
  4. 1
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs
  5. BIN
      Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/init_db.sql - Raccourci.lnk

@ -16,7 +16,7 @@
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },
"applicationUrl": "https://localhost:8081;http://localhost:8080", "applicationUrl": "https://localhost:5001;http://localhost:5000",
"dotnetRunMessages": true "dotnetRunMessages": true
}, },
"IIS Express": { "IIS Express": {

@ -38,7 +38,7 @@ public class Startup
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseCors( 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.UseSwagger();
app.UseSwaggerUI(); app.UseSwaggerUI();

@ -8,7 +8,8 @@
"AllowedHosts": "*", "AllowedHosts": "*",
"Sql": { "Sql": {
"LoadFake": false, "LoadFake": false,
//"ConnectionString": "server=db;user=root;password=root;database=collaborateur_epa" "ConnectionString": "server=database;user=root;password=root;database=collaborateur_epa" //préprod
"ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa" //"ConnectionString": "server=db;user=root;password=root;database=collaborateur_epa" //docker-compose
//"ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa" //local
} }
} }

@ -43,6 +43,7 @@ public class GenericSqlRepository<T> : IGenericRepository<T> where T : class, IG
public virtual T? Update(T entity) public virtual T? Update(T entity)
{ {
Context.ChangeTracker.Clear();
Context.Set<T>().Update(entity); Context.Set<T>().Update(entity);
Context.SaveChanges(); Context.SaveChanges();

Loading…
Cancel
Save