Ejemplo n.º 1
0
        public async Task <ActionResult <List <ProfileDto> > > GetProfilesByIdsAsync(string profileIds)
        {
            try
            {
                var intOnlyString = new string(profileIds.ToCharArray().Where(c => char.IsDigit(c)).ToArray());
                var intArray      = intOnlyString.Select(digit => int.Parse(digit.ToString())).ToList();

                return(Ok(new Response {
                    Success = true, Data = { ProfileModels = await _profileDataService.GetProfilesByIdsAsync(intArray) }
                }));
            }
            catch (Exception e)
            {
                return(BadRequest(new Response {
                    Success = false, ErrorMessage = e.Message
                }));
            }
        }