diff --git a/Tsi1.Api/Tsi1.BusinessLayer/Interfaces/ITenantService.cs b/Tsi1.Api/Tsi1.BusinessLayer/Interfaces/ITenantService.cs index a1b88ed057e0435a0c6ff68901bdccd86d235ca4..b97247fb27e1a995e0e4ea7382aad4a834f572be 100644 --- a/Tsi1.Api/Tsi1.BusinessLayer/Interfaces/ITenantService.cs +++ b/Tsi1.Api/Tsi1.BusinessLayer/Interfaces/ITenantService.cs @@ -15,7 +15,7 @@ namespace Tsi1.BusinessLayer.Interfaces Task<ServiceResult<List<TenantPreviewDto>>> GetAll(); - Task<ServiceResult<TenantPreviewDto>> Create(TenantCreateDto newTenant); + Task<ServiceResult<int>> Create(TenantCreateDto newTenant); Task<ServiceResult<bool>> Modify(int tenantId, TenantCreateDto tenantDto); diff --git a/Tsi1.Api/Tsi1.BusinessLayer/Services/TenantService.cs b/Tsi1.Api/Tsi1.BusinessLayer/Services/TenantService.cs index 17d6668ac6a2234260d9a64fb1007dcdeefa7437..4b256db290876ebe198b13d00cc5dfc64381f074 100644 --- a/Tsi1.Api/Tsi1.BusinessLayer/Services/TenantService.cs +++ b/Tsi1.Api/Tsi1.BusinessLayer/Services/TenantService.cs @@ -57,9 +57,9 @@ namespace Tsi1.BusinessLayer.Services return result; } - public async Task<ServiceResult<TenantPreviewDto>> Create(TenantCreateDto newTenant) + public async Task<ServiceResult<int>> Create(TenantCreateDto newTenant) { - var result = new ServiceResult<TenantPreviewDto>(); + var result = new ServiceResult<int>(); var existingTenant = await _context.Tenants.FirstOrDefaultAsync(x => x.Name == newTenant.Name); @@ -75,8 +75,7 @@ namespace Tsi1.BusinessLayer.Services await _context.SaveChangesAsync(); - result.Data = _mapper.Map<TenantPreviewDto>(tenant); - + result.Data = tenant.Id; return result; }