everything works now
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-05-19 23:14:57 +02:00
parent 0b01340e88
commit beab15a7ef
10 changed files with 168 additions and 32 deletions

View File

@ -4,6 +4,7 @@ using HanyadikHetVan.Data.Entities;
using HanyadikHetVan.DTO;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -20,10 +21,10 @@ namespace HanyadikHetVan.Services
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
}
public async Task<FunFactDTO> GetFunFactOfWeeklyTimeSpan(int weeklytimespanId)
public async Task<List<FunFactDTO>> GetFunFactOfWeeklyTimeSpan(int weeklytimespanId)
{
var funfact = await _dbContext.FunFacts.Where(x => x.WeeklyTimeSpanId == weeklytimespanId).FirstOrDefaultAsync();
return _mapper.Map<FunFact, FunFactDTO>(funfact);
var funfact = await _dbContext.FunFacts.Where(x => x.WeeklyTimeSpanId == weeklytimespanId).ToListAsync();
return _mapper.Map<List<FunFact>, List<FunFactDTO>>(funfact);
}
public async Task<double> GetFunFactorOfFunFact(int funfactId)