@using Microsoft.AspNetCore.Hosting @using Microsoft.AspNetCore.Mvc.ViewEngines @using Microsoft.EntityFrameworkCore; @using Remotely.Server.Services @using Remotely.Shared.Models @using Remotely.Shared.Entities @inject IApplicationConfig AppConfig @inject IWebHostEnvironment Environment @inject ICompositeViewEngine Engine @inject IDataService DataService @{ var organizationName = "Remotely"; var userResult = await DataService.GetUserByName( $"{User?.Identity?.Name}", query => query.Include(x => x.Organization)); var user = userResult.Value; if (user is null) { var orgResult = await DataService.GetDefaultOrganization(); if (orgResult.IsSuccess) { organizationName = orgResult.Value.OrganizationName; } } else if (!string.IsNullOrWhiteSpace(user.Organization?.OrganizationName)) { organizationName = user.Organization.OrganizationName; } }