public IActionResult All()
        {
            TenantListModel model = new TenantListModel()
            {
                Tenants = _tenants.GetAll().Select(t => new TenantItemModel()
                {
                    Id             = t.Id,
                    FullName       = t.FullName,
                    Address        = t.RentedProperty.Address,
                    Email          = t.Email,
                    PhoneNumber    = t.PhoneNumber,
                    DateOfMovingIn = t.DateOfMovingIn.ToString("dd/MM/yyyy"),
                    Debt           = _tenants.GetMoneyOwed(t.Id)
                })
            };

            return(View(model));
        }
Beispiel #2
0
        //[Authorize(Roles  = "Admin")]
        public async Task <IEnumerable <Tenant> > GetTenant()
        {
            var Models = await _tenant.GetAll();

            return(Models);
        }