//[ResponseCache(Duration = 5000)] public async Task <IActionResult> GetLevelLearnedSpellsAsync([FromServices] ILevelLearnedSpellRepository levelLearnedSpellRepository, [FromServices] ITypeConverterProvider <SpellLevelLearned, SpellLevelLearnedDefinition> converter) { SpellLevelLearned[] levelLearneds = await levelLearnedSpellRepository.RetrieveAllAsync(); return(Json(CreatedSpellLevelLearnedCollectionResponse(levelLearneds, converter))); }
//[ResponseCache(Duration = 5000)] public async Task <IActionResult> GetLevelLearnedSpellsForClassAsync([FromRoute(Name = "class")] EntityPlayerClassType classType, [FromServices] ILevelLearnedSpellRepository levelLearnedSpellRepository, [FromServices] ITypeConverterProvider <SpellLevelLearned, SpellLevelLearnedDefinition> converter) { if (!Enum.IsDefined(typeof(EntityPlayerClassType), classType)) { throw new InvalidEnumArgumentException(nameof(classType), (int)classType, typeof(EntityPlayerClassType)); } SpellLevelLearned[] levelLearneds = await levelLearnedSpellRepository.RetrieveAllAsync(classType); return(Json(CreatedSpellLevelLearnedCollectionResponse(levelLearneds, converter))); }