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

@@ -40,7 +40,11 @@ namespace DaSaSo.EntityFramework.Services
{
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
{
SewerObject? s = await context.SewerObjects.Include("BuildingSite").FirstOrDefaultAsync((e) => e.Id == id);
SewerObject? s = await context.SewerObjects
.Include("BuildingSite")
.Include("PunktOben")
.Include("PunktUnten")
.FirstOrDefaultAsync((e) => e.Id == id);
return s;
}
}

View File

@@ -1,6 +1,7 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services;
using DaSaSo.EntityFramework.Services.Common;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
namespace DaSaSo.EntityFramework.Services
{
public class SewerpointDataService : IDataService<SewerPoint>
public class SewerpointDataService : ISewerPointDataService
{
private readonly DaSaSoDbContextFactory _contextFactory;
private readonly NonQueryDataService<SewerPoint> _nonQueryDataService;
@@ -45,6 +46,14 @@ namespace DaSaSo.EntityFramework.Services
throw new NotImplementedException();
}
public async Task<SewerPoint> GetbyObjektname(string objektname)
{
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
{
return await context.SewerPoints.FirstOrDefaultAsync((e) => e.Objektnummer == objektname);
}
}
public async Task<SewerPoint> Update(int id, SewerPoint entity)
{
return await _nonQueryDataService.Update(id, entity);