try following changes
public ActionResult Edit(Hotel hotel)
{
if (ModelState.IsValid)
{
hotel.Status = 1;
db.Entry(hotel).State = EntityState.Modified;
var hFacilities = Request["HotelFesilityId"].Split(',');
foreach (var hf in hFacilities)
{
var hfid = Convert.ToInt32(hf);
var a= db.HotelFesilities.Where(id==hfid).Count();
if(a>0)
{
}
else
{
}
hotel.HotelFesilities.Add(hotelfaciliti);
}
db.SaveChanges();
return RedirectToAction("Index");
}
ViewBag.HotelCategoryHotelCategoryId = new SelectList(db.HotelCategories, "HotelCategoryId", "CategoryName", hotel.HotelCategoryHotelCategoryId);
return View(hotel);
}
Hope this will help u...
-Sagar Solanki