mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add instruction set creation in admin view.
This commit is contained in:
@@ -37,6 +37,19 @@ namespace Marechai.Services
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<int> CreateAsync(InstructionSet viewModel)
|
||||
{
|
||||
var model = new InstructionSet
|
||||
{
|
||||
Name = viewModel.Name
|
||||
};
|
||||
|
||||
await _context.InstructionSets.AddAsync(model);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return model.Id;
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(int id)
|
||||
{
|
||||
InstructionSet item = await _context.InstructionSets.FindAsync(id);
|
||||
|
||||
Reference in New Issue
Block a user