Setup And Getting Started Forum

Error for the first time run CMS
RE: Error for the first time run CMS

 
I think my current version it not yours, b/c it's GetCurrentPortal() have no try catch block:

internal Portal GetCurrentPortal()
{
//if httpcontext is null this is a unit test so just pick the default portal
if (HttpContext.Current == null)
{
IEnumerable<Portal> portals = _inmemorycacheService.Get(PortalsHolder, () => _portalRepository.ListPortals());
return portals.Where(portal => portal.Name.Equals("Default")).FirstOrDefault();
}
else
{
string url = HttpContext.Current.Request.Url.Authority.ToLower();
IEnumerable<Portal> portals = _inmemorycacheService.Get(PortalsHolder, () => _portalRepository.ListPortals());
return portals.Where(portal => portal.URLAuthority.Equals(url)).FirstOrDefault();
}
}
2 years 2 months 18 days ago by phuonglewis

Replies