Beispiel #1
0
        public IActionResult Index()
        {
            var branches = _branch.GetAll().Select(branch => new BranchDeatailModel
            {
                Id          = branch.ID,
                Address     = branch.Address,
                Description = branch.Description,
                ImageUrl    = branch.ImageUrl,
                Name        = branch.Name,
                NOOfAssets  = _branch.GetAssets(branch.ID).Count(),
                NOOfPatrons = _branch.Getpatrons(branch.ID).Count(),
                IsOpen      = _branch.IsBranchOpen(branch.ID),
                Telephone   = branch.Telephone
            });

            var model = new BranchIndexModel
            {
                Branches = branches
            };

            return(View(model));
        }