mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add code to delete machine families.
This commit is contained in:
@@ -19,5 +19,17 @@ namespace Marechai.Services
|
||||
{
|
||||
Id = m.Id, Company = m.Company.Name, Name = m.Name
|
||||
}).ToListAsync();
|
||||
|
||||
public async Task DeleteAsync(int id)
|
||||
{
|
||||
MachineFamily item = await _context.MachineFamilies.FindAsync(id);
|
||||
|
||||
if(item is null)
|
||||
return;
|
||||
|
||||
_context.MachineFamilies.Remove(item);
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user