Sewerpoints und Objektnummern hinzugefügt

This commit is contained in:
HuskyTeufel
2021-09-28 17:52:17 +02:00
parent e8674fed2c
commit a8029c091d
27 changed files with 1196 additions and 67 deletions

View File

@@ -1,6 +1,7 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -9,20 +10,25 @@ namespace DaSaSo.Domain.Services.SewerPointServices
{
public class SewerpointService : ISewerpointService
{
private readonly IDataService<SewerPoint> _sewerPointService;
private readonly ISewerPointDataService _sewerPointService;
public SewerpointService(IDataService<SewerPoint> sewerPointService)
public SewerpointService(ISewerPointDataService sewerPointService)
{
_sewerPointService = sewerPointService;
}
public async Task<SewerPoint> CreateOrFindSewerpoint(string objektbezeichnung)
{
SewerPoint result = new SewerPoint()
SewerPoint result = await _sewerPointService.GetbyObjektname(objektbezeichnung);
if(result == null)
{
Objektnummer = objektbezeichnung
};
return await _sewerPointService.Create(result);
SewerPoint newPoint = new SewerPoint()
{
Objektnummer = objektbezeichnung
};
result = await _sewerPointService.Create(newPoint);
}
return result;
}
}
}