public async Task <IActionResult> GetAllStaticData() { var user = await userManager.GetUserAsync(HttpContext.User); IEnumerable <GetUserDecksWithHeapsAndTags.ResultModel> decksWithHeapsAndTags; if (user == null) { decksWithHeapsAndTags = new GetUserDecksWithHeapsAndTags.ResultModel[0]; } else { decksWithHeapsAndTags = await new GetUserDecksWithHeapsAndTags(dbContext).RunAsync(user.Id); } var allTags = new GetAllAvailableTags(dbContext).Run(); var allUsers = new GetUsers(dbContext).Run(); GetAllStaticDataViewModel value = new GetAllStaticDataViewModel(decksWithHeapsAndTags, allTags, allUsers, localizer, decksControllerLocalizer, user); return(base.Ok(value)); }
public IActionResult GetAllAvailableTags() { var result = new GetAllAvailableTags(dbContext).Run(); return(base.Ok(result.Select(tag => new GetAllAvailableTagsViewModel(tag.TagId, tag.Name)))); }