Example #1
0
        public IEnumerable <Building> GetBuildingsByLandlord()
        {
            string   userJWTId = User.FindFirst("id")?.Value;
            Landlord landlord  = LandlordDB.GetCurrentLandlord(userJWTId);

            if (landlord == null)
            {
                return(null);
            }

            //int take = 10;
            //int skip = (pageNumber - 1) * take;
            //int totalCount = BuildingDB.GetBuildingsCountByLandlord(landlord.Id);

            return(BuildingDB.GetBuildingsByLandlord(landlord.Id));
        }
Example #2
0
        public IActionResult GetLandlordById(int id)
        {
            string   userJWTId = User.FindFirst("id")?.Value;
            Landlord landlord  = LandlordDB.GetCurrentLandlord(userJWTId);

            if (landlord == null)
            {
                //Client client = clientDB.GetEntity(id);
                //if (client == null)
                return(NotFound());
            }

            return(new ObjectResult(landlord));
        }