31 lines
834 B
C#
31 lines
834 B
C#
using DaSaSo.Domain.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DaSaSo.Domain.Services.BuildingsiteServices
|
|
{
|
|
public class BuildingsiteService : IBuildingsiteService
|
|
{
|
|
private readonly IDataService<Project> _projectService;
|
|
|
|
public BuildingsiteService(IDataService<Project> projectService)
|
|
{
|
|
_projectService = projectService;
|
|
}
|
|
|
|
public async Task<Buildingsite> CreateBuildingsite(Project proj)
|
|
{
|
|
Buildingsite buildingsite = new Buildingsite()
|
|
{
|
|
Project = proj
|
|
};
|
|
proj.BuildingSites.Add(buildingsite);
|
|
await _projectService.Update(proj.Id, proj);
|
|
return buildingsite;
|
|
}
|
|
}
|
|
}
|