public SuiteBO Update(SuiteBO s)
        {
            var x = Delete(s.Id);

            Create(s);
            return(s);
        }
Ejemplo n.º 2
0
        public IActionResult Post([FromBody] SuiteBO suiteBO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            return(Ok(facade.SuiteService.Create(suiteBO)));
        }
Ejemplo n.º 3
0
        public IActionResult Put(int id, [FromBody] SuiteBO suiteBO)
        {
            if (id != suiteBO.Id)
            {
                return(StatusCode(405, "Path Id does not match Room Id in json object"));
            }

            try
            {
                var suiteUpdated = facade.SuiteService.Update(suiteBO);
                return(Ok(suiteUpdated));
            }
            catch (InvalidOperationException e)
            {
                return(StatusCode(404, e.Message));
            }
        }
 public SuiteBO Create(SuiteBO s)
 {
     s.Id = suites.Count + 1;
     suites.Add(s);
     return(s);
 }