Add code to delete machine families.

This commit is contained in:
2020-05-24 21:45:43 +01:00
parent c31b4d3fb3
commit 3d0bfe41dd
5 changed files with 93 additions and 76 deletions

View File

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