Exemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <PersonDisplay> > > GetPersons()
        {
            if (User.IsInRole("admin"))
            {
                return(Ok((await _bll.Persons.GetAllPersonsAsync()).Select(e =>
                                                                           _mapper.PersonViewDisplayMapper(e))));
            }

            var g = User.UserId();

            //var b = await _bll.Persons.GetAllFamilyPersons(User.UserId());
            //var g = b.Select(e => _mapper.Map(e));
            return(Ok((await _bll.Persons.GetAllFamilyPersons(User.UserId())).Select(e =>
                                                                                     _mapper.PersonDisplayMapper(e))));
        }