Exemple #1
0
        public async Task <IEnumerable <CampingTripFull> > Get()
        {
            var identity = (ClaimsIdentity)User.Identity;
            IEnumerable <Claim> claims = identity.Claims;

            var role = claims.Where(claim => claim.Type == "role")?.FirstOrDefault();

            if (role?.Value == "Admin")
            {
                return(await campingTripRepository.GetAllRegistartionNotCompletedCampingTripsAsync());
            }
            else
            {
                return(await campingTripRepository.GetAllRegistartionNotCompletedCampingTripsForUserAsync());
            }
        }