mergemaain
continuous-integration/drone/push Build is failing Details

pull/9/head
etudiant 2 years ago
parent fc71fca415
commit 374a2ad873

@ -9,6 +9,7 @@
<PropertyGroup Condition=" '$(RunConfiguration)' == 'https' " />
<PropertyGroup Condition=" '$(RunConfiguration)' == 'http' " />
<PropertyGroup Condition=" '$(RunConfiguration)' == 'RestFull' " />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
@ -25,6 +26,9 @@
<ProjectReference Include="..\BowlingService\BowlingService.csproj" />
<ProjectReference Include="..\Mapper\Mapper.csproj" />
<ProjectReference Include="..\DTOs\DTOs.csproj">
<GlobalPropertiesToRemove></GlobalPropertiesToRemove>
</ProjectReference>
</ItemGroup>
<ItemGroup>

@ -1,4 +1,5 @@
using System;
using DTOs;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

@ -29,8 +29,6 @@
},
"RestFull": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:5001",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -6,7 +6,7 @@ namespace BowlingService.Interfaces
{
public interface IpartieService
{
public Task<bool> Add(PartieDTO _partie);
public Task<PartieDTO> Add(PartieDTO _partie);
public Task<bool> Delete(PartieDTO _partie);
public Task<bool> Update(PartieDTO _partie);
public Task<IEnumerable<PartieDTO>> GetAll();

@ -32,17 +32,19 @@ namespace BowlingService.Interfaces
//Add
public async Task<bool> Add(PartieDTO _partie)
public async Task<PartieDTO> Add(PartieDTO _partie)
{
bool result = false;
PartieDTO result = null;
using (var context = new BowlingContext())
{
PartieEntity entity = _mapper.Map<PartieEntity>(_partie);
context.Parties.Add(entity);
//context.Parties.Add(entity);
try
{
var data = await context.SaveChangesAsync();
result = data == 1;
//var data = await context.SaveChangesAsync();
result =_mapper.Map<PartieDTO>(await _IpartieRepository.Add(entity));
_logger.LogInformation("A new player was added : {player}", _partie.Id);
}

Loading…
Cancel
Save