Sewerpoints und Objektnummern hinzugefügt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user