예제 #1
0
        public async Task <IActionResult> GetMotivationsForType(string motivationType)
        {
            var user = await GetOrThrowForCurrentUser().ConfigureAwait(false);

            if (!Enum.TryParse(typeof(MotivationType), motivationType, out var result))
            {
                return(BadRequest($"Enum type not recognised: {motivationType}"));
            }
            return(Ok(await _motivationQueries.GetAllForType((MotivationType)result).ConfigureAwait(false)));
        }