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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user