Schächte werden nun hinzugefügt

This commit is contained in:
2023-03-31 15:01:39 +02:00
parent 70bba66df3
commit d4b38ff7ae
33 changed files with 927 additions and 30 deletions

View File

@@ -0,0 +1,31 @@
using SewerStammGen.Shared.Contracts;
using Shared.Contracts;
using Shared.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SewerStammGen.Shared.Services
{
public class SchachtService : ISchachtService
{
private readonly IDataService<Projekt> _projectService;
public SchachtService(IDataService<Projekt> projectService)
{
_projectService = projectService;
}
public async Task<Schacht> CreateSchacht(Projekt proj)
{
Schacht schacht = new Schacht() {
Projekt = proj
};
proj.Schaechte.Add(schacht);
await _projectService.Update(proj.Id, proj);
return schacht;
}
}
}