public async Task <IActionResult> GetUsersCharades([FromQuery] GetCharadesRequestModel model) { if (!ModelState.IsValid) { return(BadRequest()); } var criteria = mapper.Map <GetCharadesCriteria>(model); var charades = await charadesCompositionService.GetCharades(criteria); return(Ok(charades)); }
private static ICollection<EntrySource> BoolsToEntrySourcesConverter(GetCharadesRequestModel model) { var sources = new List<EntrySource>(); bool includeAnimes = model.IncludeAnimeLists; if (includeAnimes) { sources.Add(EntrySource.Anime); } bool includeMangas = model.IncludeMangaLists; if (includeMangas) { sources.Add(EntrySource.Manga); } return sources; }