protected override UserCacheItem MapToCacheItem(User entity) { var item = base.MapToCacheItem(entity); var ou = OrganizationUnitRepository.GetAllWithoutTracking() .Join(UserOrganizationUnitRepository.GetAllWithoutTracking(), a => a.Id, b => b.OrganizationUnitId, (a, b) => new { a.Id, a.DisplayName }) .FirstOrDefault(); if (ou != null) { item.OrganizationUnitId = ou.Id; item.OrganizationUnitName = ou.DisplayName; } return(item); }