Exemplo n.º 1
0
        public async Task <IActionResult> GetApps()
        {
            var subject = HttpContext.User.OpenIdSubject();

            var entities = await appProvider.GetUserApps(subject);

            var response = entities.Select(a => AppDto.FromApp(a, subject, appPlansProvider)).ToList();

            return(Ok(response));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetApps()
        {
            var userId          = HttpContext.User.OpenIdSubject();
            var userPermissions = HttpContext.User.Permissions();

            var entities = await appProvider.GetUserApps(userId, userPermissions);

            var response = entities.ToArray(a => AppDto.FromApp(a, userId, userPermissions, appPlansProvider));

            Response.Headers["ETag"] = response.ToManyEtag();

            return(Ok(response));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetApps()
        {
            var userOrClientId  = HttpContext.User.UserOrClientId();
            var userPermissions = HttpContext.Permissions();

            var apps = await appProvider.GetUserApps(userOrClientId, userPermissions);

            var response = apps.ToArray(a => AppDto.FromApp(a, userOrClientId, userPermissions, appPlansProvider, this));

            Response.Headers[HeaderNames.ETag] = response.ToManyEtag();

            return(Ok(response));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> GetApps()
        {
            var userOrClientId  = HttpContext.User.UserOrClientId();
            var userPermissions = HttpContext.Permissions();

            var apps = await appProvider.GetUserApps(userOrClientId, userPermissions);

            var response = Deferred.Response(() =>
            {
                return(apps.OrderBy(x => x.Name).Select(a => AppDto.FromApp(a, userOrClientId, userPermissions, appPlansProvider, this)).ToArray());
            });

            Response.Headers[HeaderNames.ETag] = apps.ToEtag();

            return(Ok(response));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> GetApps()
        {
            var subject = HttpContext.User.OpenIdSubject();

            var apps = await appProvider.GetUserApps(subject);

            var response = apps.Select(a =>
            {
                var dto = SimpleMapper.Map(a, new AppDto());

                dto.Permission = a.Contributors[subject];

                dto.PlanName    = appPlansProvider.GetPlanForApp(a)?.Name;
                dto.PlanUpgrade = appPlansProvider.GetPlanUpgradeForApp(a)?.Name;

                return(dto);
            }).ToList();

            return(Ok(response));
        }