mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add screen creation in admin view.
This commit is contained in:
@@ -52,6 +52,20 @@ namespace Marechai.Services
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<int> CreateAsync(ScreenViewModel viewModel)
|
||||
{
|
||||
var model = new Screen
|
||||
{
|
||||
Diagonal = viewModel.Diagonal, EffectiveColors = viewModel.EffectiveColors, Height = viewModel.Height,
|
||||
NativeResolutionId = viewModel.NativeResolutionId, Type = viewModel.Type, Width = viewModel.Width
|
||||
};
|
||||
|
||||
await _context.Screens.AddAsync(model);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return model.Id;
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(int id)
|
||||
{
|
||||
Screen item = await _context.Screens.FindAsync(id);
|
||||
|
||||
Reference in New Issue
Block a user