Ejemplo n.º 1
0
 public void Setup()
 {
     _restaurantService = new RestaurantService();
     _adressService     = new AdressService();
     _mainRestaurant    = new Restaurant("le rating", "0788888888", "bonjour je suis le test de restaurant", "*****@*****.**", null);
     _restaurantService.AddRestaurant(_mainRestaurant);
 }
Ejemplo n.º 2
0
        public IHttpActionResult Delete(int id)
        {
            var       adressService = new AdressService();
            AdressDTO avm           = adressService.deleteAdress(id);

            if (avm == null)
            {
                return(BadRequest("This adress does not exist in DB"));
            }
            return(Ok(avm));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Post(AdressDTO adress)
        {
            AdressService adressService = new AdressService();
            AdressDTO     avm           = adressService.addAdress(adress);

            if (avm == null)
            {
                return(BadRequest("This adress already exist in DB"));
            }

            return(Ok(avm));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Get(int id)
        {
            var adressService = new AdressService();

            AdressDTO adressVM = adressService.getAdressById(id);

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

            return(Ok(adressVM));
        }
 public AdressController(AdressService adressService)
 {
     _adressService = adressService;
 }