Change AgeGroup ID type from int to string and add migration

Refactored AgeGroupController, AgeGroupService, and IAgeGroupService to use string IDs instead of int. Added initial Entity Framework migration and database files to support AltersGruppe with string primary key.
This commit is contained in:
2025-12-07 20:32:49 +01:00
parent 9128b199e9
commit aacd8b7d96
9 changed files with 133 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ namespace API.Repository.AgeGroup
return altersGruppe;
}
public async Task<AltersGruppe?> DeleteAsync(int id)
public async Task<AltersGruppe?> DeleteAsync(string id)
{
var group = await _context.Altersgruppen.FirstOrDefaultAsync(x => x.Id == id);
@@ -42,12 +42,12 @@ namespace API.Repository.AgeGroup
return allGroups;
}
public async Task<AltersGruppe?> GetAsync(int id)
public async Task<AltersGruppe?> GetAsync(string id)
{
return await _context.Altersgruppen.FindAsync(id);
}
public async Task<AltersGruppe?> UpdateAsync(int id, AltersGruppe altersGruppe)
public async Task<AltersGruppe?> UpdateAsync(string id, AltersGruppe altersGruppe)
{
var existingGroup = await _context.Altersgruppen.FirstOrDefaultAsync(x => x.Id == id);

View File

@@ -6,9 +6,9 @@ namespace API.Repository.AgeGroup
{
public Task<List<AltersGruppe>> GetAllAsync();
public Task<AltersGruppe?> GetAsync(int id);
public Task<AltersGruppe?> GetAsync(string id);
public Task<AltersGruppe> CreateAsync(AltersGruppe altersGruppe);
public Task<AltersGruppe?> DeleteAsync(int id);
public Task<AltersGruppe?> UpdateAsync(int id, AltersGruppe altersGruppe);
public Task<AltersGruppe?> DeleteAsync(string id);
public Task<AltersGruppe?> UpdateAsync(string id, AltersGruppe altersGruppe);
}
}