public dynamic StartRoom(int id) { SketchEntities datacontext = new SketchEntities(); var _room = datacontext.Room.First(c => c.Id == id); _room.status = 1; datacontext.SaveChanges(); return(_room); }
public dynamic EndRoom(int id) { SketchEntities datacontext = new SketchEntities(); var _room = datacontext.Room.First(c => c.Id == id); _room.status = 2; datacontext.SaveChanges(); List <Room> RoomList = new List <Room>(); var rooms = datacontext.Room.Where(c => c.Id == id); foreach (var room in rooms) { var art = new Room() { Description = room.Description ?? "", Id = room.Id, Name = room.Name, status = room.status, Facebook = room.Facebook }; RoomList.Add(art); } return(RoomList.ToArray()); }