Beispiel #1
0
        public void GetPropertyByIdTest_ReturnProperty()
        {
            var Property = _realStateAPIRepository.GetPropertyById(1);

            Assert.AreNotEqual(Property, null);

            Assert.Pass();
        }
        public ActionResult <PropertyDTO> GetPropertyById(int idProperty)
        {
            try
            {
                Property property = _realStateAPIRepository.GetPropertyById(idProperty);

                if (property == null)
                {
                    return(NotFound());
                }

                PropertyDTO propertyDTO = _mapper.Map <PropertyDTO>(property);

                return(propertyDTO);
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }