public int DeleteBooking(int id)
        {
            int result = 0;

            if (db != null)
            {
                var post = db.Booking.FirstOrDefault(x => x.Id == id);

                if (post != null)
                {
                    db.Booking.Remove(post);
                    result = db.SaveChanges();
                    return(1);
                }
                return(result);
            }
            return(result);
        }
Example #2
0
 public string Post([FromBody] room value)
 {
     _context.booking.Add(value);
     _context.SaveChanges();
     return("sucess");
 }
Example #3
0
 public string Post([FromBody] Boarder value)
 {
     _context.Boarders.Add(value);
     _context.SaveChanges();
     return("sucess");
 }