Rename service.

This commit is contained in:
2020-05-29 02:45:06 +01:00
parent fdc371bee3
commit e77bcc3aa4
5 changed files with 10 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.99.1374</Version> <Version>3.0.99.1377</Version>
<Company>Canary Islands Computer Museum</Company> <Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright> <Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product> <Product>Canary Islands Computer Museum Website</Product>

View File

@@ -39,7 +39,7 @@
@inject CompaniesService CompaniesService @inject CompaniesService CompaniesService
@inject MachineFamiliesService MachineFamiliesService @inject MachineFamiliesService MachineFamiliesService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject GpuByMachineService GpuByMachineService @inject GpusByMachineService GpusByMachineService
@inject GpusService GpusService @inject GpusService GpusService
@inject SoundSynthsByMachineService SoundSynthsByMachineService @inject SoundSynthsByMachineService SoundSynthsByMachineService
@inject SoundSynthsService SoundSynthsService @inject SoundSynthsService SoundSynthsService

View File

@@ -66,7 +66,7 @@ namespace Marechai.Pages.Admin.Details
_companies = await CompaniesService.GetAsync(); _companies = await CompaniesService.GetAsync();
_families = await MachineFamiliesService.GetAsync(); _families = await MachineFamiliesService.GetAsync();
_model = _creating ? new MachineViewModel() : await Service.GetAsync(Id); _model = _creating ? new MachineViewModel() : await Service.GetAsync(Id);
_machineGpus = await GpuByMachineService.GetByMachine(Id); _machineGpus = await GpusByMachineService.GetByMachine(Id);
_gpus = await GpusService.GetAsync(); _gpus = await GpusService.GetAsync();
_soundSynths = await SoundSynthsService.GetAsync(); _soundSynths = await SoundSynthsService.GetAsync();
@@ -183,8 +183,8 @@ namespace Marechai.Pages.Admin.Details
// Yield thread to let UI to update // Yield thread to let UI to update
await Task.Yield(); await Task.Yield();
await GpuByMachineService.DeleteAsync(_currentGpuByMachine.Id); await GpusByMachineService.DeleteAsync(_currentGpuByMachine.Id);
_machineGpus = await GpuByMachineService.GetByMachine(Id); _machineGpus = await GpusByMachineService.GetByMachine(Id);
_deleteInProgress = false; _deleteInProgress = false;
_frmDelete.Hide(); _frmDelete.Hide();
@@ -232,8 +232,8 @@ namespace Marechai.Pages.Admin.Details
// Yield thread to let UI to update // Yield thread to let UI to update
await Task.Yield(); await Task.Yield();
await GpuByMachineService.CreateAsync(_addingGpuId.Value, Id); await GpusByMachineService.CreateAsync(_addingGpuId.Value, Id);
_machineGpus = await GpuByMachineService.GetByMachine(Id); _machineGpus = await GpusByMachineService.GetByMachine(Id);
_addingGpu = false; _addingGpu = false;
_savingGpu = false; _savingGpu = false;

View File

@@ -7,11 +7,11 @@ using Microsoft.EntityFrameworkCore;
namespace Marechai.Services namespace Marechai.Services
{ {
public class GpuByMachineService public class GpusByMachineService
{ {
readonly MarechaiContext _context; readonly MarechaiContext _context;
public GpuByMachineService(MarechaiContext context) => _context = context; public GpusByMachineService(MarechaiContext context) => _context = context;
public async Task<List<GpuByMachineViewModel>> GetByMachine(int machineId) => public async Task<List<GpuByMachineViewModel>> GetByMachine(int machineId) =>
await _context.GpusByMachine.Where(g => g.MachineId == machineId).Select(g => new GpuByMachineViewModel await _context.GpusByMachine.Where(g => g.MachineId == machineId).Select(g => new GpuByMachineViewModel

View File

@@ -62,7 +62,7 @@ namespace Marechai.Services
services.AddScoped<Iso31661NumericService>(); services.AddScoped<Iso31661NumericService>();
services.AddScoped<ResolutionsService>(); services.AddScoped<ResolutionsService>();
services.AddScoped<CompanyLogosService>(); services.AddScoped<CompanyLogosService>();
services.AddScoped<GpuByMachineService>(); services.AddScoped<GpusByMachineService>();
services.AddScoped<SoundSynthsByMachineService>(); services.AddScoped<SoundSynthsByMachineService>();
} }
} }