fix hints and warnings

This commit is contained in:
Tim Wundenberg
2021-08-01 12:22:12 +02:00
parent c6d6a437dc
commit 419a468dc5
15 changed files with 90 additions and 152 deletions

View File

@@ -3,7 +3,6 @@ using PointCloudWeb.Server.Models;
using PointCloudWeb.Server.Services;
using System;
using System.Collections.Generic;
using System.Linq;
namespace PointCloudWeb.Server.Controllers
{
@@ -11,11 +10,11 @@ namespace PointCloudWeb.Server.Controllers
[Route("[controller]")]
public class PointCloudController
{
private readonly PointCloudService pointCloudService;
private readonly PointCloudService _pointCloudService;
public PointCloudController(PointCloudService pointCloudService)
{
this.pointCloudService = pointCloudService;
this._pointCloudService = pointCloudService;
}
private PointCloudDto ConvertPointCloudToDto(PointCloud pc) => new PointCloudDto(pc.Id, pc.TransformedPoints);
@@ -24,7 +23,7 @@ namespace PointCloudWeb.Server.Controllers
public IList<PointCloudDto> GetAll()
{
var result = new List<PointCloudDto>();
foreach (var pc in pointCloudService.GetAll())
foreach (var pc in _pointCloudService.GetAll())
result.Add(ConvertPointCloudToDto(pc));
return result;
@@ -33,7 +32,7 @@ namespace PointCloudWeb.Server.Controllers
[HttpGet]
public PointCloudDto GetById(Guid id)
{
var pc = pointCloudService.GetById(id) ?? throw new KeyNotFoundException();
var pc = _pointCloudService.GetById(id) ?? throw new KeyNotFoundException();
return ConvertPointCloudToDto(pc);
}
}