private Task <AppDto> InvokeCommandAsync(ICommand command) { return(InvokeCommandAsync(command, x => { var userOrClientId = HttpContext.User.UserOrClientId() !; var isFrontend = HttpContext.User.IsInClient(DefaultClients.Frontend); return AppDto.FromDomain(x, userOrClientId, isFrontend, Resources); })); }
public IActionResult GetApp(string app) { var response = Deferred.Response(() => { var userOrClientId = HttpContext.User.UserOrClientId() !; var isFrontend = HttpContext.User.IsInClient(DefaultClients.Frontend); return(AppDto.FromDomain(App, userOrClientId, isFrontend, Resources)); }); Response.Headers[HeaderNames.ETag] = App.ToEtag(); return(Ok(response)); }
public async Task <IActionResult> GetApps() { var userOrClientId = HttpContext.User.UserOrClientId() !; var userPermissions = Resources.Context.UserPermissions; var apps = await appProvider.GetUserAppsAsync(userOrClientId, userPermissions, HttpContext.RequestAborted); var response = Deferred.Response(() => { var isFrontend = HttpContext.User.IsInClient(DefaultClients.Frontend); return(apps.OrderBy(x => x.Name).Select(a => AppDto.FromDomain(a, userOrClientId, isFrontend, Resources)).ToArray()); }); Response.Headers[HeaderNames.ETag] = apps.ToEtag(); return(Ok(response)); }