fix de l'update des entités

pull/10/head
Clement FERRERE 3 years ago
parent ae3f2beb05
commit a49c9ec876
  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": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:8081;http://localhost:8080",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"dotnetRunMessages": true
},
"IIS Express": {

@ -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();

@ -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
}
}

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

Loading…
Cancel
Save