public AdminHomeViewModel New()
 {
     return(new AdminHomeViewModel
     {
         ApplicationCount = licenceRepository.GetAllApplications().Count(),
         LicenceCount = licenceRepository.GetAllLicences().Count()
     });
 }
        public IList <LicenceApplicationViewModel> BuildLicencesForUser(string userId)
        {
            var licences = licenceRepository.GetAllApplications().Where(x => x.UserId == userId);

            var models = new List <LicenceApplicationViewModel>();

            foreach (var licence in licences)
            {
                models.Add(Build <LicenceApplicationViewModel>(licence.Id));
            }

            return(models);
        }
 public AdminLicenceListViewModel Build(LicenceOrApplication type)
 {
     return(type == LicenceOrApplication.Application
         ? new AdminLicenceListViewModel
     {
         Title = "Applications",
         Licences = licenceRepository.GetAllApplications().Select(BuildSummary)
     }
         : new AdminLicenceListViewModel
     {
         Title = "Licences",
         Licences = licenceRepository.GetAllLicences().Select(BuildSummary)
     });
 }